Jump to content

if $ then go to section1


Guest Guest_LoneReaper
 Share

Recommended Posts

Guest Guest_LoneReaper

I have an if statement and if its true i want it to go to a section of the script and if not go to another section. what is that called?

Link to comment
Share on other sites

There are several ways to accomplish this, and each has advantages depending on the rest of your code.

Method 1: If-Else

If <CONDITION> Then
   ;do your "true" code here
Else
   ;do your "false" code here
EndIf

Method 2: Select-Case

Select
  Case <CONDITION>
     ;do your "true" code here
  Case Else
     ;do your "false" code here
EndSelect

Method 3: Functions

If <CONDITION> Then
  TrueFunction()
Else
  FalseFunction()
EndIf

;rest of your script goes here as required

Func TrueFunction()
   ;do your "true" code here
EndFunc

Func FalseFunction()
   ;do your "false" code here
EndFunc

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

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...