Sub Process_Globals
Private sb(3) As StringBuilder
Private startName As String = "Activity_Create(FirstTime As Boolean)"
End Sub
#if B4J
Sub AppStart (Form1 As Form, Args() As String)
startName = "AppStart (Form1 As Form, Args() As String)"
#else if B4A
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
#end if
sb(0).initialize: sb(1).initialize: sb(2).initialize
toLines(0, "Sub Process_Globals")
toLines(0, " Private sb(3) As StringBuilder")
toLines(0, " Private startName As String = 'Activity_Create(FirstTime As Boolean)'")
toLines(0, "End Sub")
toLines(0, "#if B4J")
toLines(0, "Sub AppStart (Form1 As Form, Args() As String)")
toLines(0, " startName = 'AppStart (Form1 As Form, Args() As String)'")
toLines(0, "#else if B4A")
toLines(0, "Sub Globals")
toLines(0, "End Sub")
toLines(0, "Sub Activity_Create(FirstTime As Boolean)")
toLines(0, "#end if")
toLines(0, " sb(0).initialize: sb(1).initialize: sb(2).initialize")
toLines(2, " Log(sb(0).Append(sb(1).ToString).Append(sb(2).toString).toString)")
toLines(2, "End Sub")
toLines(2, "Sub toLines(i As Int, s As String)")
toLines(2, " If i = 0 Then s = s.Replace('*', startName)")
toLines(2, " sb(i).Append(s.Replace(Chr(39), QUOTE) & CRLF)")
toLines(2, " sb(1).Append(TAB & 'toLines(' & i & ', ' & QUOTE & s & QUOTE & ')' & CRLF)")
toLines(2, "End Sub")
Log(sb(0).Append(sb(1).ToString).Append(sb(2).toString).toString)
End Sub
Sub toLines(i As Int, s As String)
If i = 0 Then s = s.Replace("*", startName)
sb(i).Append(s.Replace(Chr(39), QUOTE) & CRLF)
sb(1).Append(TAB & "toLines(" & i & ", " & QUOTE & s & QUOTE & ")" & CRLF)
End Sub