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
Stephenos
Beginner


Joined: 06 Jul 2007
Posts: 27

PostPosted: Sat Aug 01, 2009 1:00 am   

How do I...
 
I am trying to make a generalized queue or stack management routine and am having trouble with %pop and assignments.

I know that %pop takes the name of a list not the list itself. I also know I assign to the name of a variable, not what is currently in the variable.

Is there a way to do these things when the name of a variable (or list variable) is stored in another, local variable.?

If x = 1|2 and $name = x is there a way to do something like %pop(x), but by working on the $name variable? I tried %pop({$name}) and that didn't work.

Is there a way to assign a new value to x indirectly through the $name variable?

Thanks
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Aug 03, 2009 6:50 am   
 
%pop(%string($name))

#var %string($name) value

#say $name is @{$name}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Stephenos
Beginner


Joined: 06 Jul 2007
Posts: 27

PostPosted: Mon Aug 03, 2009 10:43 pm   
 
Very cool, Fang. Thanks!
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