BIS fnc swapVars: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *arma2 * * *\| *([0-1]\.[0-9]{2}) * \|game2" to "|game1= arma2 |version1= $1 |game2")
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(7 intermediate revisions by the same user not shown)
Line 26: Line 26:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>_a = 1;
|x1= <sqf>private _a = 1;
_b = 2;
_b = 2;
["_a", "_b"] [[call]] [[BIS_fnc_swapVars]];
["_a", "_b"] call BIS_fnc_swapVars;
_a == 2; {{cc|true}}
_a == 2; // true
_b == 1; {{cc|true}}</code>
_b == 1; // true</sqf>
 
|seealso=
}}
}}
[[Category:{{Name|arma2oa}}: Functions|{{uc:swapVars}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:swapVars}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:swapVars}}]]

Latest revision as of 18:00, 13 July 2022

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:
private _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