Sending Arguments to B4PPC App

linum

Active Member
Licensed User
I have two apps that work together. One acts as a login screen where users can login, the other app is the actual User Interface. Normally a user will login and if the password turns out to be correct then the app creates a .txt file with the username and some other info. I then shell the second app and the first thing the other app does is read the .txt file and loads the appropriate form based on the .txt file info. So...

I want to get away from using .txt files and I know I can accomplish this if I could simply send the user data as an argument when I shell the second app. Is it possible for a B4PPC app to receive arguments? If so, how do I intercept the argument? Can somebody post a code sample of this?


Thanks...
 

mjcoon

Well-Known Member
Licensed User
The Help contains the following topic:

B4X:
Command Line Arguments

Reading the command line arguments is done using a special built-in array named args.
Use ArrayLen to find the number of arguments available.
In order to simulate command line arguments from the IDE you can use Tools - Command line arguments.

Example:
Sub Globals

End Sub
Sub App_Start
      For i = 0 To ArrayLen(args())-1
            Msgbox(args(i))
      Next
End Sub
 
Top