hey there folks--
I'm trying to pass in a command-line parameter to an exe and it seems that there are a couple "special" characters that aren't allowed? the code is simple enough:
this works just fine unless the parameter starts with "/" (slash), "-" (dash), or "+" (plus) (without the quotes).. in those cases, parameters() returns 0 and tcCLP is .F. i get the same results starting from Start->Run or a command prompt, altho, running the prg from the command window works fine, tho there i have to enclose the parameter in quotes.
are these special characters that aren't allowed to start a command-line parameter? i'd like to be able to use a / or - since it's pretty standard.
any thoughts?
thanks
-- frank~
I'm trying to pass in a command-line parameter to an exe and it seems that there are a couple "special" characters that aren't allowed? the code is simple enough:
Code:
LPARAMETERS tcCLP
LOCAL llInvalidCLP
STORE .f. to llInvalidCLP
=MESSAGEBOX(TRANSFORM(PARAMETERS()))
=MESSAGEBOX(TRANSFORM(tcCLP))
IF PARAMETERS() > 0
IF TYPE('tcCLP') == 'C'
tcCLP = UPPER(ALLTRIM(tcCLP))
DO CASE
CASE tcCLP == '/C'
llNewConfig = .t.
OTHERWISE
llInvalidCLP = .t.
ENDCASE
ELSE
llInvalidCLP = .t.
ENDIF
IF llInvalidCLP
=MESSAGEBOX("Command-line parameter usage:"+CHR(13)+CHR(13)+;
"/c -"+CHR(9)+" Create a new INI file"+CHR(13)+;
"/? -"+CHR(9)+" This help screen",0+16,"")
dropout(plDev)
ENDIF
ENDIF
this works just fine unless the parameter starts with "/" (slash), "-" (dash), or "+" (plus) (without the quotes).. in those cases, parameters() returns 0 and tcCLP is .F. i get the same results starting from Start->Run or a command prompt, altho, running the prg from the command window works fine, tho there i have to enclose the parameter in quotes.
are these special characters that aren't allowed to start a command-line parameter? i'd like to be able to use a / or - since it's pretty standard.
any thoughts?
thanks
-- frank~