Jump to content

basic IF help needed

Recommended Posts

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


if $cmdline[1] < 500 then

$time = 1000


$time = $cmdline[1]




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 post
Share on other sites

how do you get the $cmdline - array?

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


@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


$cmdline[0] Holds the count, so test the incoming parameter count against $cmdline[0] Edited by MHz
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...