Jump to content

basic IF help needed


MCT
 Share

Recommended Posts

hey all, i wanna make a file that runs other files @ a specific time

example

if $cmdline[1] < 500 then

$time = 1000

else

$time = $cmdline[1]

run($cmdline[2])

sleep($time)

run($cmdline[3])

i can get it to work but if $cmdline[3] doesnt exist, i want it to just process cmdline 1 & 2

Edited by MCT
Link to comment
Share on other sites

how do you get the $cmdline - array?

$cmdline[?] is a built in array for incoming parameters to the script.

http://www.autoitscript.com/autoit3/docs/i...htm#CommandLine

@MCT, This example If block of code may suit your needs ?

If $cmdline[0] = 2 Then

; can use $cmdline[1] and $cmdline[2] here

ElseIf $cmdline[0] = 3 Then

; can use $cmdline[1], $cmdline[2] and $cmdline[3] here

EndIf

$cmdline[0] Holds the count, so test the incoming parameter count against $cmdline[0] Edited by MHz
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...