BIS fnc swapVars: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Variables(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:


{{Function|Comments=
{{Function|Comments=
____________________________________________________________________________________________


| arma2 |Game name=
| arma2 |Game name=
Line 8: Line 7:


|gr1 = Variables |GROUP1=
|gr1 = Variables |GROUP1=
____________________________________________________________________________________________


| Swaps the values of two variables '''passed as [[String]]'''.<br>
| Swaps the values of two variables '''passed as [[String]]'''.<br>
Nothing is returned as this function modifies the variables directly. |DESCRIPTION=
Nothing is returned as this function modifies the variables directly. |DESCRIPTION=
____________________________________________________________________________________________


| [variableName1, variableName2] call [[BIS_fnc_swapVars]] |SYNTAX=
| [variableName1, variableName2] call [[BIS_fnc_swapVars]] |SYNTAX=
Line 21: Line 18:


| [[Nothing]] |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________


|x1= <code>_a = 1;
|x1= <code>_a = 1;
Line 28: Line 24:
_a == 2; {{codecomment|// true}}
_a == 2; {{codecomment|// true}}
_b == 1; {{codecomment|// true}}</code> |EXAMPLE1=
_b == 1; {{codecomment|// true}}</code> |EXAMPLE1=
____________________________________________________________________________________________


| |SEEALSO=
| |SEEALSO=

Revision as of 00:46, 17 January 2021


Hover & click on the images for description

Description

Description:
Swaps the values of two variables passed as String.
Nothing is returned as this function modifies the variables directly.
Execution:
call
Groups:
Variables

Syntax

Syntax:
[variableName1, variableName2] call BIS_fnc_swapVars
Parameters:
variableName1: String
variableName2: String
Return Value:
Nothing

Examples

Example 1:
_a = 1; _b = 2; ["_a", "_b"] call BIS_fnc_swapVars; _a == 2; // true _b == 1; // true

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