I would like to read command$ so I can do this:
"myapp.exe debug"
IF command$ = "debug" THEN
%DEBUG = -1
ELSE
%DEBUG = 0
END IF
I would do that in FF_WINMAIN.
James,
The only issue with your code is that using %DEBUG is not a variable that can be set at run time. You would need to use either a local or probably a global variable.
Andrew
In FF_AppSTart .. I can set %DEBUG to whatever I want ...
I was wanting to set it via command$ ...
I think what Andrew meant was that %DEBUG is not a variable, its an Equate (Constant), and those cannot be set (change its value) at run time. You would need a global variable, because the values of equates can only be set at compile-time.
Elias - exactly right.
You probably also want to use something like:
' Global Storage for Debug State
Global DebugMode as Long
' Position of Parameter in Command$
local ParamPos as Long
ParamPos = instr$(ucase$(Command$), "DEBUG")
If ParamPos > 0 then
' Debug Mode Set
DebugMode = %True
Else
' Debug Mode Not Set
DebugMode = %False
End If
So you can test for more than one command line option and possibly pass parameters.
Peter
I'm only looking for one command$ item.. just to signal whether I want to enable ztrace statements or not.
If command$ = "debug" Then gztrace = -1
If gztrace = -1 then
ztrace "my data is " & mydata
end if
So I only have to add ' debug ' to the command line parameter in the project environment to enable ztrace output.
I guess if anyone else has problems I can also use the "debug" command$ to generate output for trouble shooting...