BIS fnc swapVars: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling - missing see also)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Swaps the values of two variables '''passed as [[String]]'''.<br />
/************************************************************
Nothing is returned as this function modifies the variables directly. |= Description
Swap Variables
____________________________________________________________________________________________


Parameters: ["variable name 1", "variable name 2"]
| [variableName1, variableName2] call [[BIS_fnc_swapVars]] |= Syntax


Swaps the values of two variables, passed in quotes.
|p1= variableName1: [[String]] |= Parameter 1


Nothing is returned, as this function modifies the variables
|p2= variableName2: [[String]] |= Parameter 2
directly.


Example:
| [[Nothing]] |= Return value
____________________________________________________________________________________________


_a = 1;
|x1= <code>_a = 1;
_b = 2;
_b = 2;
["_a","_b"] call BIS_fnc_swapVars
["_a", "_b"] [[call]] [[BIS_fnc_swapVars]];
//_a now equals 2
_a == 2; {{codecomment|// true}}
//_b now equals 1
_b == 1; {{codecomment|// true}}</code> |= Example 1
 
************************************************************/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_swapVars]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=  
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| |= See also
}}
}}



Revision as of 10:32, 22 April 2018


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:
Uncategorised

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