piccaso Posted May 17, 2004 Posted May 17, 2004 here is my (rather simple) approach func GetOpt ($option) local $i for $i = 1 to $CmdLine[0] if $CmdLine[$i] == $option Then if $i+1 > $CmdLine[0] Then return 1 else return $CmdLine[$i+1] endif endif next return 0 endfunc for example Getopt("/a") Returns 'Hello' if you start the prog using 'filename /a Hello' Getopt("/a") Returns 'Hell o' if you start the prog using 'filename /a "Hell o" ' Getopt("/x") Returns 1 if you start the prog using 'filename /x' Getopt("/x") Retuns 0 if you start the prog using 'filename /a /v /c lalala' or no parameters looks nice until here but Getopt("/a") Retuns '/x' if you start the prog using 'filename /a /x' ok you can still use 'if Getopt("/a") <> 0 Then...' did anybody out there do something better? CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
piccaso Posted May 17, 2004 Author Posted May 17, 2004 It Should help you Dealing parameters From the commandlineSee Autoit Helpfile -> Using Autoit -> Running Scripts (The second half) CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
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