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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Feb 20, 2004 3:31 am   

Variable expression problem 7.0
 
Tried to get this to work with no luck:

#var scline {big|red|dog}
#loop 1,%numitems(@scline) {#var var %left(%item(@scline,%i),1);#show @@var}

tried this too
#forall @scline {#show @%left(%i,1)}
the screen in both of these just showed
@b
@r
@d


wanted to see what was in the vars.

Am I missing something, will try to find another way just thought you guys might know something about it.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Feb 20, 2004 4:51 am   
 
That's not the correct syntax. If you want to use indirect evaluation and display a variable who's name is also a variable or function, the correct syntax is:

#SHOW @{%left(%i,1)}

or, more generally:

@{expression}

So in your first example, it would be #SHOW @{@var}
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Feb 20, 2004 2:51 pm   
 
Thank You :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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