Engine:CCMD var

Revision as of 00:32, 14 October 2023 by Bear (talk | contribs)
Console commands

Creates and sets a variable in the current context.

set bob fred

Arguments

  • name - name for variable to set
  • value (optional) - the value to set. If no value, then prints value if exists.

Details

Can be used to set values for variables. Will create a new variable is not exists.

Examples

Default values

  • 'set' called with 'bob' without a value. Variable 'bob' doesn't exist.
> set bob
Unknown: bob
  • Creates variable 'bob' and sets to 'fred'.
> set bob fred
  • Same as the first example, but now bob exists.
> var bob
'bob' is 'fred'
  • Try to set existing 'bob' to 'james', value changes.
> var bob james
> var bob
'bob' is 'james'

Notes