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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Tue Jul 08, 2008 8:36 am   

[2.30] BUG: scoping, variables and specifically: %expand
 
Code:
   <class name="Class1" id="1256">
    <var name="scope" id="1258">scope1</var>
    <alias name="sct1" id="1261">
      <value>#SA say only: @scope
#SA with ~%expand: %expand(@scope)</value>
    </alias>
  </class>
  <class name="Class2" id="1257">
    <var name="scope" id="1259">scope2</var>
    <alias name="sct2" id="1262">
      <value>#SA say only: @scope
#SA with ~%expand: %expand(@scope)</value>
    </alias>
  </class>

To run the test script, enter 'sct1' at the command line, and then 'sct2'.
The following four lines are displayed when I do this:

with %expand: scope2
say only: scope1
with %expand: scope2
say only: scope2
with %expand: scope2

As you can see, the simple "#SA @scope" correctly searches for the variable within its own class first, and accesses it.
However, when %expand(@scope) is used, it uses the variable in class2 in both instances.

Edit: I should add that %expand is the only function I've found that does this. #SH %concat(@scope) displays correctly, for example. It seems to be particular to %expand.
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 08, 2008 5:02 pm   
 
Added to bug list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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