Sign in to follow this  
Followers 0
MCT

basic IF help needed

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

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