BIS fnc swapVars: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
/************************************************************
|version4= 0.50
Swap Variables


Parameters: ["variable name 1", "variable name 2"]
|gr1= Variables


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


Nothing is returned, as this function modifies the variables
|s1= [variableName1, variableName2] call [[BIS_fnc_swapVars]]
directly.


Example:
|p1= variableName1: [[String]]


_a = 1;
|p2= variableName2: [[String]]
_b = 2;
["_a","_b"] call BIS_fnc_swapVars
//_a now equals 2
//_b now equals 1


************************************************************/
|r1= [[Nothing]]


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|x1= <sqf>private _a = 1;
____________________________________________________________________________________________
_b = 2;
 
["_a", "_b"] call BIS_fnc_swapVars;
| <!-- [] call [[BIS_fnc_swapVars]]; --> |= Syntax
_a == 2; // true
 
_b == 1; // true</sqf>
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso=
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Variables|{{uc:swapVars}}]]
[[Category:Functions|{{uc:swapVars}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:swapVars}}]]
[[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