try: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
[[Category:Scripting Commands|TRY]]
{{Command|= Comments
[[Category:Scripting Commands ArmA|TRY]]
____________________________________________________________________________________________
[[Category:Armed Assault: Control Flows|TRY]]


| arma |= Game name


<h2 style="color:#000066">''' try ''code'''''</h2>
|2.6|= Game version
____________________________________________________________________________________________


| Defines a try-catch structure. This sets up an [[exception handling]] block. Any thrown exception in a try block is caught in a [[catch]] block. |= Description
____________________________________________________________________________________________


'''Operand types:'''
| '''try''' code |= Syntax


'''code:''' [[Code]]
|p1= code: [[Code]] |= Parameter 1


'''Type of returned value:'''
| [[Nothing]] |= Return value
____________________________________________________________________________________________


[[Nothing]]
|  |= See also


'''Compatibility:'''
}}


Version 2.60 required.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<!-- Note Section END -->
</dl>


Defines a try-catch structure.
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|TRY]]
This sets up an [[Exception handling|exception handling]] block.
[[Category:Scripting Commands ArmA|TRY]]
 
[[Category:Armed Assault: Control Flows|TRY]]
Any thrown exception in a '''try''' block is caught in a [[catch]] block.
 
 
'''Example:'''
 
'''try''' {
  if (_name == "") then {
    [[throw]] "No Name"
  }
}
 
[[catch]] {
  if (_exception == "No Name") then {
    ....
  }
}

Revision as of 22:56, 1 August 2006

-wrong parameter ("Arma") defined!-2.6
Hover & click on the images for description

Description

Description:
Defines a try-catch structure. This sets up an exception handling block. Any thrown exception in a try block is caught in a catch block.
Groups:
Uncategorised

Syntax

Syntax:
try code
Parameters:
code: Code
Return Value:
Nothing

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

Bottom Section