Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.19

Description

Description:Swaps the values of two variables, passed in quotes. Nothing is returned, as this function modifies the variables directly.
This function can be useful if you do not wish to create a third variable, just to do the swap.

Syntax

Syntax:[var1, var2] call fn_vbs_swapVars
Parameters:
  • var1: String - Variable name of the first variable, in quotes.
  • var2: String - Variable name of the second variable, in quotes.
Return Value:Nothing

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_a = 1;
_b = 2;
["_a","_b"] call fn_vbs_swapVars
//_a now equals 2
//_b now equals 1

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes