Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Dim ObscureSeperator = "%~#&@#!%"
'Dim Obscure2 = "&" & "%~#&@#!%" & "&"
Dim TableSep As String : TableSep = "!T&B%L!" 'SPECIAL CHARACTERS DO NOT USE! \ ^ ${ } [ ] ( ) . + ? | - &
Dim RecordSep As String : RecordSep = "!R&E%C!" ' \ is the escape char and the char after it is the literal
Dim FieldSep As String : FieldSep = "!F&L%D!"
End Sub
Sub GetData_Click
Dim Tbls() As String, Rec() As String, fld() As String, RecX As Int, TblX As Long, FldX As Long, Ftxt As String, Test As Long
Ftxt=File.ReadString( File.DirInternal, FileToGet.text)
If Main.SQL1.IsInitialized = False Then Main.SQL1.Initialize(File.DirInternal, "PartsAndTime.db", False)
Main.SQL1.ExecNonQuery("DELETE FROM EmpInfoLookups;")
Main.SQL1.BeginTransaction
Tbls=Regex.Split(TableSep, Ftxt)
TblX=0
Rec=Regex.Split(RecordSep,Tbls(TblX))
For RecX = 0 To Rec.Length - 1
fld=Regex.Split(FieldSep,Rec(RecX))
Main.SQL1.ExecNonQuery2("INSERT INTO EmpInfoLookups VALUES(?, ?, ?, ?, ?)", Array As Object(fld(0), fld(1), fld(2), fld(3), fld(4) ) )
Next
Main.SQL1.TransactionSuccessful
Main.SQL1.EndTransaction
Dim Cur As Cursor
Cur = Main.SQL1.ExecQuery("SELECT * FROM EmpInfoLookups;")
Cur.Position=Cur.RowCount-1
For FldX=0 To 4
Log(Cur.GetColumnName(FldX) & " = " & Cur.GetString(Cur.GetColumnName(FldX)))
Next
End Sub