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
swooster
Newbie


Joined: 19 Jun 2002
Posts: 3
Location: USA

PostPosted: Fri Jun 21, 2002 2:02 pm   

Expanding a variable non-recursively
 
I'm trying to make an alias that will add a string to the status... my current code is:

#if (%len( @SystemStatusDefinition)) {
#var SystemStatusDefinition {@{SystemStatusDefinition}"~ ~ ~ ~ %1"}
} {
#var SystemStatusDefinition %1
}
#status @SystemStatusDefinition

My problem is, when it expands @SystemStatusDefinition, it expands any references to variables inside it... This means my status ends up getting set to "AltCmd: sneak CurrentVictim: Bob LockpickCountdown: @lpcount", so if I change my current victim, the status doesn't reflect that change (but the last item, such as the lockpick timer, works fine). Is there any way to get at the contents of @SystemStatusDefinition without expanding what's inside of it? Thanks.

-Swooster
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jun 21, 2002 3:15 pm   
 
You can use %expand to limit variable expansion.

It might be better to make your #STATUS command directly though. As it is, your status line should only change when @SystemStatusDefinition changes.

LightBulb
Senior Member
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sat Jun 22, 2002 12:35 am   
 
First lets simplify. A space or four at the end of the status line will be invisible. So we will put spaces on at the end of each addittion and skip the IF.

#AL StAdd {SystemStatusDefinition=%concat(%expand(@SystemStatusDefinition,1),"%1 ")}
#AL StClear {SystemStatusDefinition=""}

Next simplification is that the status line only has to be defined once and then will update itself.
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