gespinoza Posted November 23, 2005 Posted November 23, 2005 Greetings Friends... I am using: $COPIAS = $$CmdLine[1 ] Since I make the validation when it does not come the information and power to assign a value to the variable $COPIAS? Thanks for its invaluable aid. Atte.Gonzalo Espinoza B.Consultor en InformáticaCel. (593-9) 619-4108Guayaquil - Ecuador
ivan Posted November 23, 2005 Posted November 23, 2005 Besides the fact that you are using a double dollar sign "$$", there should be nothing wrong in the assignment. should really read $COPIAS = $CmdLine[1] Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3
gespinoza Posted November 24, 2005 Author Posted November 24, 2005 Greetings. Excuse was a write error, the commando as I am using it is: $COPIAS = $CmdLine[1 ]When I execute the program, ex: Script.exe 01 Work in correct form.But when I do it: Script.exe without the argument, gives an error me, which is correct. What I require is to validate that that field comes with value and if the instruction is not asi to send a message of error to the user using: MsgBox Atte.Gonzalo Espinoza B.Consultor en InformáticaCel. (593-9) 619-4108Guayaquil - Ecuador
w0uter Posted November 24, 2005 Posted November 24, 2005 if $cmdline[0] <> 0 Then ... else ... endif My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
gespinoza Posted November 24, 2005 Author Posted November 24, 2005 Greetings friends... The programs use some variables: $VAR1 = $CmdLine[1 ] $VAR2 = $CmdLine[2 ] $VAR3 = $CmdLine[3 ] The instruction that you indicate to me I have used it and works when value has not been specified some. But, like been worth if: $VAR3 = $CmdLine[3 ] comes without value?Thanks for its invaluable aid Atte.Gonzalo Espinoza B.Consultor en InformáticaCel. (593-9) 619-4108Guayaquil - Ecuador
w0uter Posted November 24, 2005 Posted November 24, 2005 read the helpfile.if $cmdline[0] > 3 Then...else...endif My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
LxP Posted November 25, 2005 Posted November 25, 2005 Hi Gonzalo, Perhaps this code will work nicely for you: If $CmdLine[0] < 3 Then MsgBox(0x10, 'Error', 'You have specified ' & $CmdLine[0] & ' parameters. 3 are required.') Exit EndIf $Var1 = $CmdLine[1] $Var2 = $CmdLine[2] $Var3 = $CmdLine[3]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now