• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

@if

JScript3.0+Syntax

@if (condition1)
  statement1
@elif (condition2)
  statement2
@else
  statement3
@end

Description

The @if statement operates much like a typical if conditional statement but evaluates compiled variables and has a slightly different syntax. If the expression in condition1 evaluates to true, statement1 is executed. Otherwise, the condition2 is evaluated to determine if statement2 should be evaluated. The @elif statement operates the same as the JavaScript else… if statement, even though it looks different. You can use as many @elif statements as needed or none at all. Only one @else statement should be used to catch conditions that don't meet any of the previous conditionals. Like the @elif statement, the @else statement is optional. The @end statement is required at the end of all if conditionals.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint