Private Sub Command1_Click()
  Dim utm As UTMStruct
  Dim dms As DMSStruct
  Dim eflag As Integer
  Dim Hemi as string*1
  
  utm.east = 583437.1197
  utm.north = 4744785.5664
  utm.ZoneLetter = "T"
  utm.ZoneNumber = 18
  utm.geoid = 5         'NAD27
  
  eflag = UTM2LL(utm)
  If eflag = WICNOERROR Then
   Call DtoDMS(utm.Latitude, dms)
   If dms.Sign=-1 then
     Hemi="S"
   else
     Hemi="N"
   end if
   Label1.Caption = "Latitude: " & _
                    Format(dms.Degrees, "00") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN) & _
                    Hemi
   Call DtoDMS(utm.Longitude, dms)
   If dms.Sign=-1 then
     Hemi="W"
   else
     Hemi="E"
   end if
   Label2.Caption = "Longitude: " & _
                    Format(dms.Degrees, "00") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN) & _
                    Hemi
  Else
    lblMessage.Caption = "Error in conversion - error is " & Format(eflag, "00")
  End If
  
End Sub

Private Sub Command2_Click()
  End
End Sub

Private Sub Form_Load()

  lblTitle.Caption = "Testing UTM2LL"
  lblMessage.Caption = "Press Do It! to convert or Quit to quit"
  Label1.Caption = ""
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  
End Sub
