Engine:CCMD varedit: Difference between revisions

No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 21: Line 21:
== Examples ==
== Examples ==
=== Default values ===
=== Default values ===
* 'bob' without a value. Variable 'bob' doesn't exist, and 'bob' is not the name of anything else.
<kua>
<kua>
> bob
> bob
Unknown: bob
Unknown: bob
</kua>
</kua>
* Tries to set variable 'bob' to 'fred'. Fails as 'bob' does not exist.  
No 'bob' in the context. Variable 'bob' doesn't exist, and 'bob' is not the name of anything else.
 
<kua>
<kua>
> bob fred
> bob fred
Unknown: bob
Unknown: bob
</kua>
</kua>
* Using the 'set' command to create the variable 'bob' and set to 'fred'.  
Tries to set variable 'bob' to 'fred'. Fails as 'bob' does not exist.
 
<kua>
<kua>
> set bob fred
> set bob fred
</kua>
</kua>
* Same as the first example, but now 'bob' exists.
Uses the 'set' command to create the variable 'bob' and set value to 'fred'.
 
<kua>
<kua>
> bob
> bob
'bob' is 'fred'
'bob' is 'fred'
</kua>
</kua>
* Try to set existing 'bob' to 'james', value changes.  
Same as the first example, but now 'bob' exists.
 
<kua>
<kua>
> bob james
> bob james
Line 46: Line 49:
'bob' is 'james'
'bob' is 'james'
</kua>
</kua>
Tries to set existing 'bob' to 'james', value changes.


=== Change if exists ===
=== Change if exists ===