then: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (merged to the if statement)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| First or second element of array is executed depending on result of [[if]] condition. Result of the expression executed is returned as a result (result may be nothing). |= Description
| '''then''' is not a stand-alone command. It can only be used as part of the [[if]] statement |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| if '''then''' else |= Syntax
|p1= if: [[If Type]] |= Parameter 1
|p2= else: [[Array]] |= Parameter 2
| [[Anything]] |= Return value
____________________________________________________________________________________________
|x1 = <code>[[if]] (a>b) then <nowiki>{c=1}</nowiki> [[else]] <nowiki>{c=2}</nowiki></code> | = Example 1
|x2 = <code>[[if]] (a>b) then <nowiki>{c=1;c=2}</nowiki></code>| = Example 2
| [[Control Structures]], [[if]], [[else]] |= See also
| [[Control Structures]], [[if]], [[else]] |= See also



Revision as of 06:13, 5 September 2007

Hover & click on the images for description

Description

Description:
then is not a stand-alone command. It can only be used as part of the if statement
Groups:
Uncategorised

Syntax

Syntax:
Control Structures, if, else
Return Value:
Return value needed

Examples

Examples:
Example needed

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Ceeeb
Any variables you declare within the body of an if/then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement.

Bottom Section