Engine:CCMD set
Jump to navigation
Jump to search
Creates and sets a variable in the current context.
set bob fred
Arguments[edit]
- name - name for variable to set
- value (optional) - the value to set. If no value, then prints value if exists.
Details[edit]
Can be used to set values for variables. Will create a new variable is not exists.
Examples[edit]
Default values[edit]
- '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'