home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form maploc_form
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Load / Save Map Coordinates"
- ClientHeight = 1395
- ClientLeft = 1785
- ClientTop = 3135
- ClientWidth = 6075
- Height = 1800
- Left = 1725
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1395
- ScaleWidth = 6075
- Top = 2790
- Width = 6195
- Begin SSPanel Panel3D1
- Align = 1 'Align Top
- Alignment = 6 'Center - TOP
- BackColor = &H00C0C0C0&
- BorderWidth = 1
- Caption = "Select an existing name, or enter a new name"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 825
- Left = 0
- Outline = -1 'True
- RoundedCorners = 0 'False
- TabIndex = 4
- Top = 0
- Width = 6075
- Begin SSPanel Panel3D2
- Alignment = 6 'Center - TOP
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- BorderWidth = 1
- Caption = "Panel3D2"
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 435
- Left = 120
- Outline = -1 'True
- RoundedCorners = 0 'False
- TabIndex = 5
- Top = 300
- Width = 5865
- Begin ComboBox map_loc_list
- BackColor = &H00FFFFFF&
- Height = 300
- Left = 30
- TabIndex = 6
- Top = 60
- Width = 5775
- End
- End
- End
- Begin CommandButton map_loc_done
- Caption = "Done"
- Height = 375
- Left = 4290
- TabIndex = 2
- Top = 900
- Width = 975
- End
- Begin CommandButton map_loc_delete
- Caption = "Delete"
- Height = 375
- Left = 3090
- TabIndex = 3
- Top = 900
- Width = 975
- End
- Begin CommandButton map_loc_save
- Caption = "Add"
- Height = 375
- Left = 1890
- TabIndex = 1
- Top = 900
- Width = 975
- End
- Begin CommandButton map_loc_load
- Caption = "Load"
- Height = 375
- Left = 720
- TabIndex = 0
- Top = 900
- Width = 975
- End
- Sub Form_Load ()
- load_locations
- End Sub
- Sub load_locations ()
- While map_loc_list.ListCount > 0
- map_loc_list.RemoveItem 0
- Wend
- map_handle = FreeFile
- On Error Resume Next
- Open "wais.loc" For Input As map_handle
- If Err Then
- If 6 = MsgBox("'WAIS.LOC' file is missing! Create it?", MB_WARN Or 4) Then
- Open "wais.loc" For Output As map_handle
- Close (map_handle)
- Exit Sub
- Else
- maploc_form.hide
- Exit Sub
- End If
- End If
- While Not EOF(map_handle)
- Line Input #map_handle, map_name$
- c = InStr(2, map_name$, Chr$(34))
- If c > 0 Then
- map_loc_list.AddItem Mid$(map_name$, 2, c - 2)
- End If
- Wend
- Close (map_handle)
- End Sub
- Sub map_loc_delete_Click ()
- If map_loc_list.ListIndex = -1 Then
- MsgBox "Please select a name to be deleted", MB_INFO
- Exit Sub
- End If
- in_map_handle = FreeFile
- Open "wais.loc" For Input As in_map_handle
- ot_map_handle = FreeFile
- Open "wais.l$$" For Output As ot_map_handle
- While Not EOF(in_map_handle)
- Line Input #in_map_handle, map$
- If cnt <> map_loc_list.ListIndex Then
- Print #ot_map_handle, map$
- Else
- map_loc_list.RemoveItem cnt
- End If
- cnt = cnt + 1
- Wend
- Close (in_map_handle)
- Close (ot_map_handle)
- Kill "wais.loc"
- Name "wais.l$$" As "wais.loc"
- End Sub
- Sub map_loc_done_Click ()
- maploc_form.hide
- End Sub
- Sub map_loc_load_Click ()
- If map_loc_list.ListIndex < 0 Then
- MsgBox "Please select an entry from the list", MB_INFO
- Exit Sub
- End If
- map_handle = FreeFile
- Open "wais.loc" For Input As map_handle
- For x = 0 To map_loc_list.ListIndex
- Line Input #map_handle, map$
- Next x
- Close (map_handle)
- p = InStr(2, map$, Chr$(34)) + 2
- For c = p To Len(map$)
- ch$ = Mid$(map$, c, 1)
-
- Select Case ch$
- Case ".", "-", "+", "0" To "9"
- num$ = num$ + ch$
- Case ","
- out_location(s1, 0) = Val(num$)
- num$ = ""
- Case " "
- out_location(s1, 1) = Val(num$)
- num$ = ""
- s1 = s1 + 1
- Case Else
- MsgBox "Format error detected in 'WAIS.LOC' file", MB_WARN
- out_point = 0
- Exit Sub
- End Select
- Next c
- out_point = s1
- maploc_form.hide
- End Sub
- Sub map_loc_save_Click ()
- If out_point = 0 Then
- MsgBox "No coordinates are available to save", MB_INFO
- Exit Sub
- End If
- If map_loc_list.Text = Space$(Len(map_loc_list.Text)) Then
- MsgBox "Please enter a unique name for these coordinates", MB_INFO
- Exit Sub
- End If
- For x = 0 To map_loc_list.ListCount - 1
- If map_loc_list.List(x) = map_loc_list.Text Then
- MsgBox "This entry already exists. Please enter a unique name", MB_INFO
- Exit Sub
- End If
- Next x
- map_loc_list.AddItem map_loc_list.Text
- map_handle = FreeFile
- Open "wais.loc" For Append As map_handle
- Print #map_handle, Chr$(34) + map_loc_list.Text + Chr$(34) + " ";
- For x = 0 To out_point - 1
- Print #map_handle, Format$(out_location(x, 0), "###.###");
- Print #map_handle, ",";
- Print #map_handle, Format$(out_location(x, 1), "###.###");
- Print #map_handle, " ";
- Next x
- Print #map_handle,
- Close (map_handle)
- End Sub
-