MattHiggs

(solved) Grouping of statements in an if statement

3 posts in this topic

#1 ·  Posted (edited)

Ok.  So while I am pretty sure this is possible, I wanted to confirm and possibly see and example rather than just play trial and error.  Is there a way to group expressions in an if statement similarly to how one can group mathematical operations so that a particular set of operations are performed first and the result of said operation can then be used with the third expression.  For example, say I had the following if statement (pseudocode):

For $i = 1 to $cmdline[0] step 1
    If ($cmdline[1] = "/r" or $cmdline[1] = "-r" ) And $i = 1 then
        ;Do something here if the first argument is either "/r" or "-r" and if $i is equal to one
    Endif
Next

Would it be possible to do something like this using a single if statement, or would I be forced to nest an if statement as well?  Thanks in advance.

Edited by MattHiggs

Share this post


Link to post
Share on other sites



#3 ·  Posted

56 minutes ago, Jos said:

That should work fine.

Jos

Thanks a ton.

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