{"name":"Identifier","title":"Identifier","type":"topic","url":"https://community.bistudio.com/wiki/Identifier","revid":377927,"updated":"2026-01-11T16:19:20Z","aliases":["identifier"],"markdown":"An Identifier is the name given to a variable that the scripter can choose: It is the name that *identifies* the variable.\n\n### Rules\n\n**Regex: `[a-zA-Z_][a-zA-Z0-9_]*`**\n\n| Valid | Invalid |\n|---|---|\n| - variable1<br>- _my_local_variable<br>- _1variable<br>- _player | - 1variable<br>- _my#localVar<br>- _guy1&2var<br>- player (player) |\n\nBinding rules for identifiers:\n\n- Identifiers may consist of any ASCII text characters (a-z, A-Z), numbers (0-9) and underscores (_).\n- Identifiers **must not** start with a number (e.g \"9myVariable\" is invalid).\n- Identifiers of local variables **must** start with an underscore.\n- Identifiers are **case-insensitive**.\n- Identifiers **cannot be the same as reserved words** (e.g commands and functions).\n\n### Recommendations\n\nIt is recommended to write **local variable identifiers** in [camel case](https://en.wikipedia.org/wiki/Camel_case) syntax. This makes identifiers more readable:\n\n```sqf\nprivate _myVariableName = 5;\n```\n\n> [!IMPORTANT]\n> [Snake case](https://en.wikipedia.org/wiki/Snake_case) is sometimes encountered but is not recommended and should be avoided:\n>\n> ```sqf\n> _my_variable_name = 5;\n> ```\n\nIt is also recommended to prefix **global variable identifiers** with **your** tag in order to avoid any potential conflict between addons, scripts and missions:\n\n```\n// Tag_identifier\nUNIQUETAG_player = player;\n```\n\n### See also\n\n- Variables","sections":[{"heading":null,"level":1,"markdown":"An Identifier is the name given to a variable that the scripter can choose: It is the name that *identifies* the variable."},{"heading":"Rules","level":3,"markdown":"**Regex: `[a-zA-Z_][a-zA-Z0-9_]*`**\n\n| Valid | Invalid |\n|---|---|\n| - variable1<br>- _my_local_variable<br>- _1variable<br>- _player | - 1variable<br>- _my#localVar<br>- _guy1&2var<br>- player (player) |\n\nBinding rules for identifiers:\n\n- Identifiers may consist of any ASCII text characters (a-z, A-Z), numbers (0-9) and underscores (_).\n- Identifiers **must not** start with a number (e.g \"9myVariable\" is invalid).\n- Identifiers of local variables **must** start with an underscore.\n- Identifiers are **case-insensitive**.\n- Identifiers **cannot be the same as reserved words** (e.g commands and functions)."},{"heading":"Recommendations","level":3,"markdown":"It is recommended to write **local variable identifiers** in [camel case](https://en.wikipedia.org/wiki/Camel_case) syntax. This makes identifiers more readable:\n\n```sqf\nprivate _myVariableName = 5;\n```\n\n> [!IMPORTANT]\n> [Snake case](https://en.wikipedia.org/wiki/Snake_case) is sometimes encountered but is not recommended and should be avoided:\n>\n> ```sqf\n> _my_variable_name = 5;\n> ```\n\nIt is also recommended to prefix **global variable identifiers** with **your** tag in order to avoid any potential conflict between addons, scripts and missions:\n\n```\n// Tag_identifier\nUNIQUETAG_player = player;\n```"},{"heading":"See also","level":3,"markdown":"- Variables"}],"categories":["Syntax"],"groups":["Scripting"]}