Sub Process_Globals
Dim TimerService As Timer
Dim Counter As Int
Counter=0
Dim sql1 As SQL
Dim msg As PhoneSms
Dim number As Long
Dim Prefix As String
Dim number1 As Double
Dim tick As Int
Dim number2 As String
End Sub
Sub Service_Create
TimerService.Initialize("TimerService",1000)
TimerService.Enabled=True
End Sub
Sub Service_Start
SQL1.Initialize(File.DirDefaultExternal, "PhoneNumber.db", True)
number1 = SQL1.ExecQuerySingleResult("SELECT min(number) FROM TpNumbers where sent = 'NO'")
Prefix = SQL1.ExecQuerySingleResult("SELECT min(Prefix) FROM Prefix")
number2 = "213" & prefix & NumberFormat2(number1,4,0,0,False)
End Sub
Sub TimerService_Tick
msg.Send(number2, "Free Android App" & CRLF & "https://market.android.com/details?id=appinventor.ai_anaylor01.VoiceNotesTrial")
SQL1.ExecNonQuery2("update TpNumbers set Sent = 'Yes' where number = ?",Array As Long(NumberFormat2(number1,4,0,0,False)))
number1 = SQL1.ExecQuerySingleResult("SELECT min(number) FROM TpNumbers where sent = 'NO'")
Prefix = SQL1.ExecQuerySingleResult("SELECT min(Prefix) FROM Prefix")
number2 = "213" & prefix & NumberFormat2(number1,4,0,0,False)
If NumberFormat2(number1,4,0,0,False) = 9999 Then
SQL1.ExecNonQuery2("delete from Prefix where Prefix = ?",Array As Int(Prefix))
SQL1.ExecNonQuery("update TpNumbers set Sent = 'NO'")
Prefix = SQL1.ExecQuerySingleResult("SELECT min(Prefix) FROM Prefix")
number1 = SQL1.ExecQuerySingleResult("SELECT min(number) FROM TpNumbers where Sent = 'NO'")
number2 = "213" & prefix & NumberFormat2(number1,4,0,0,False)
End If