### Create Non-UI App with Parameter

'Non-UI application (console application)
Region Project Notes
'B4J HowTo Project - Non-UI HelloWorld with Paremeter
'Output "HelloWorld" to the console
'From commandline run:
'java -jar helloworld.jar Hello World
'java -jar helloworld.jar "Hello World"
'For Tests the project attribute CommandLineArgs is set
'@Autor Robert W.B. Linn
'@Since 20150514
End Region
Region Project ToDo
End Region
Region Project Attributes
#CommandLineArgs: Hello World
End Region
`Sub Process_Globals
End Sub`
`Sub AppStart (Args() As String)
Log("App Startet " & DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now))
If Args.Length = 0 Then
Log("Error: Parameter Hello World or ""Hello World"" missing.")
Else
Dim sb As StringBuilder
sb.Initialize
For i = 0 To Args.Length - 1
sb.Append(Args(i)).Append(" ")
Next
Log(sb.ToString)
End If
'Stop the application
ExitApplication2(0)
End Sub`

Changed: 2017-12-13 16:43, Category: Application, File: T6C159M1149.htm, ID: 1149