Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: 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

  1. Open CMUD
  2. Dismiss the sessions window by hitting ESC
  3. Type the following at the command line and hit Enter:
    Code:
    #module other

  4. Type the following at the command line and hit Enter:
    Code:
    #var //other/foo bar
    #show @//other/foo

    The untitled window will display:
    Code:
    bar

    as expected.
  5. 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.
  6. Type the following at the command line and hit Enter:
    Code:
    #unvar //other/foo
    #show @other/foo

    Again, the untitled window will show:
    Code:
    bar

    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.
  7. 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!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: 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!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net