Engine:CCMD varedit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:
== Examples ==
== Examples ==
=== Default values ===
=== Default values ===
* In 'global' context, 'bob' without a value. Variable 'bob' doesn't exist, and 'bob' is not the name of anything else.
* 'bob' without a value. Variable 'bob' doesn't exist, and 'bob' is not the name of anything else.
<kua>
<kua>
> bob
> bob

Revision as of 03:16, 14 October 2023

Console commands

Sets an existing variable in the current context, reports variable value.

bob fred

Associations

  • Is the default command for the 'global' context.
  • Does not have its own command name in 'global' for console or script.

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 or report a value for an existing variable. Will fail if variable does not already exist.

Examples

Default values

  • 'bob' without a value. Variable 'bob' doesn't exist, and 'bob' is not the name of anything else.
> bob
Unknown: bob
  • Tries to set variable 'bob' to 'fred'. Fails as 'bob' does not exist.
> bob fred
Unknown: bob
  • Using the 'set' command to create the variable 'bob' and set to 'fred'.
> set bob fred
  • Same as the first example, but now 'bob' exists.
> bob
'bob' is 'fred'
  • Try to set existing 'bob' to 'james', value changes.
> bob james
> bob
'bob' is 'james'

Notes