#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private btnFileDialog As Button
Private fc As FileChooser
Private parser As SaxParser
Private f As String
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
MainForm.Title = "Convert .fpl To *.fms"
End Sub
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("item") > -1 Then
If Name = "waypoint" Then
Log(Text.ToString)
End If
End If
End Sub
Sub btnFileDialog_Click
fc.Initialize
fc.InitialDirectory = "C:\Documents\3DGarmin430"
fc.setExtensionFilter("ForeFlightImage", Array As String("*.fpl"))
f = fc.ShowOpen(MainForm)
Log(f)
Dim in As InputStream
in = File.OpenInput(File.DirAssets, f) 'This file was added with the file manager.
parser.Parse(f, "Parser") '"Parser" is the events subs prefix.
in.Close
End Sub