BIS fnc swapVars: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *codecomment *\| *\/\/ *([^ ]+) *\}\} " to "{{cc|$1}}") |
Lou Montana (talk | contribs) m (revert + fix) |
||
Line 3: | Line 3: | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1 = Variables | |gr1= Variables | ||
| Swaps the values of two variables '''passed as [[String]]'''.<br> | |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 directly. | ||
| [variableName1, variableName2] call [[BIS_fnc_swapVars]] | |s1= [variableName1, variableName2] call [[BIS_fnc_swapVars]] | ||
|p1= variableName1: [[String]] | |p1= variableName1: [[String]] | ||
Line 16: | Line 16: | ||
|p2= variableName2: [[String]] | |p2= variableName2: [[String]] | ||
| [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code>_a = 1; | |x1= <code>_a = 1; | ||
_b = 2; | _b = 2; | ||
["_a", "_b"] [[call]] [[BIS_fnc_swapVars]]; | ["_a", "_b"] [[call]] [[BIS_fnc_swapVars]]; | ||
_a == 2; {{cc| true}}_b == 1; {{ | _a == 2; {{cc|true}} | ||
_b == 1; {{cc|true}}</code> | |||
}} | }} | ||
[[Category:{{Name|arma2oa}}: Functions|{{uc:swapVars}}]] | [[Category:{{Name|arma2oa}}: Functions|{{uc:swapVars}}]] | ||
[[Category:{{Name|tkoh}}: Functions|{{uc:swapVars}}]] | [[Category:{{Name|tkoh}}: Functions|{{uc:swapVars}}]] | ||
[[Category:{{Name|arma3}}: Functions|{{uc:swapVars}}]] | [[Category:{{Name|arma3}}: Functions|{{uc:swapVars}}]] |
Revision as of 20:08, 29 January 2021
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