Sign in to follow this  
Followers 0
piccaso

Getopt

3 posts in this topic

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 :D

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

Share this post


Link to post
Share on other sites



uuuh what does this do ?? what is getopt ??


Share this post


Link to post
Share on other sites

It Should help you Dealing parameters From the commandline

See 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0