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
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Dec 09, 2007 2:37 pm   

[2.16] #DELITEM and #FORALL with regular variable
 
Guess what local variables seem to work great, but I guess we all forgot about regular variables.

1. Launch CMud
2. Close Sessions window (ESC)
3. Enter at the command line
Code:
DestTemp={a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y};#FORALL @DestTemp {#SHOWP {%i"-"};#DELITEM DestTemp {%i};#SHOW @DestTemp}
You will notice the list only gets half of its treatment.
4. Enter at the command line
Code:
DestTemp="a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y";#FORALL @DestTemp {#SHOWP {%i"-"};#DELITEM DestTemp {%i};#SHOW @DestTemp}
Now the #FORALL works to go through the whole list. The use of quotes changed the variable type causing seperate hash tables to be made.
5. Enter at the command line
Code:
DestTemp={a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y};#FORALL @DestTemp {#SHOW %i}
Here we see that the problem is in changing the hash table that #FORALL was referencing. I am afraid to try #ADDITEM because I can imagine it going to an infinite loop.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Dec 09, 2007 8:36 pm   
 
Confirmed.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 11, 2007 6:21 pm   
 
Yep, confirmed. The #FORALL is using the "live" hash table instead of making a copy of it at the beginning of the loop. Added to bug list.
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