|
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: Fri Nov 09, 2007 5:37 pm
[2.10] #UNVAR does not handle explicit module or class name |
Summary
It is possible to create variables in another module or class (using #var //module/varName value or #var /class/varName value) and reference them (using @//module/varName or @/class/varName) with an explicit module/class name. However, deleting a variable with similar syntax (#unvar //module/varName #unvar /class/varName) fails silently.
Procedure
- Open CMUD
- Dismiss the sessions window by hitting ESC
- Type the following at the command line and hit Enter:
Type the following at the command line and hit Enter:
Code: |
#var //other/foo bar
#show @//other/foo |
The untitled window will display:
as expected.
Type Ctrl-G to bring up the Package Editor. Verify that the module other contains a variable foo with value bar. Close the Package Editor.
Type the following at the command line and hit Enter:
Code: |
#unvar //other/foo
#show @other/foo |
Again, the untitled window will show:
This is incorrect - the var should be gone, there should be an announcement that it has been deleted, and the #show should produce a blank line.
Type Ctrl-G to bring up the Package Editor. Verify that the module other still contains a variable foo with value bar.
The same procedure, using a class name instead of a module name, fails in a similar fashion.
Notes
It is still possible to delete the variable, but you have to use:
Code: |
#module other
#unvar foo
#module 0 |
Which produces in the untitled window:
Code: |
Variable foo removed. |
And you can verify that the variable is gone using the Package Editor.
In addition, there is a separate bug which can be seen by omitting step 3 above, and I will file it separately.
This bug was encountered while attempting to build an automated test for scoping issues. |
|
_________________ Come visit Mozart Mud...and tell an imm that Aerith sent you! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 10, 2007 12:39 am |
Added to bug list.
However, keep in mind that when using #MODULE on the command line, you *must* place the entire script into one command. If you type:
#MODULE other
and press Enter, then when you enter a new command, the current module will actually be reset back to the window that you are typing in. |
|
|
|
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: Sat Nov 10, 2007 2:21 am |
Yes, I quickly discovered that the command line effectively does a #module 0 at the end of each entry. It didn't matter for this example, so it was cleaner to write the example using several lines instead.
|
|
_________________ Come visit Mozart Mud...and tell an imm that Aerith sent you! |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|