*Confessor nods*
Okay, I've got a hell of a lead on how to read/write to Random Access
files, but there's a small problem that's stopping me short of sussing
out that whole thing.
The "arrowed" line of code (as well as the two lines following, if I skip
the first/second by commenting) pops the error 'Object reference not set
to an instance of an object,' no matter what I input into the textbox.
The problem can't be (MaxPoint), since Label5.Text confirms that it's
value is 1 prior to the execution of Button1_Click, and since no code (as
of yet) even *creates* points.dat, there's no situation in which its
value can be anything other than 1 following Form1_Load.
(Note that I've used ... to excise boring, simple parts in the following
code.)
Structure PointTemplate
Dim Latitude As Single
Dim Longitude As Single
Dim Elevation As Integer
End Structure
Dim MaxPoint As Integer
Dim Point() As PointTemplate
Private Sub Form1_Load(...) Handles MyBase.Load
If IO.File.Exists("C:\...\points.dat") Then
Else
MaxPoint = 1
End If
Label5.Text = MaxPoint
End Sub
Private Sub Button1_Click(...) Handles Button1.Click
---> Point(MaxPoint).Latitude = TextBox2.Text <---
Point(MaxPoint).Longitude = TextBox3.Text
Point(MaxPoint).Elevation = TextBox4.Text
MaxPoint = MaxPoint + 1
End Sub
Thanks in Advance,
The Confessor