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



Introduced in

Version:1.22

Description

Description:

Returns true, if the given variable conforms to the engine limitations (for example, has to start with a letter or underscore, no special characters except for underscore in name).

Does not test for variables that are the same as command names, and still returns true in that situation, even though those variables should not be used (for example, isValidVarName "driver" returns true).

Syntax

Syntax:isValidVarName variable
Parameters:
  • variable: String - Variable to check.
Return Value:Boolean

Examples

Examples:
if !(isValidVarName "testvar") then {hint "invalid variable"}

Additional Information

See also: vehicleVarName, setVehicleVarName, fn vbs validateCode, fn vbs validateNumber
Multiplayer: 
Problems: 

Notes