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


Joined: 09 Jul 2008
Posts: 10

PostPosted: Tue Dec 09, 2008 12:54 pm   

# Command
 
Hi, I have a bit of a problem if anyone's got a second.

I'm trying to do something like this:
Code:
#if {@blah > 0} {#@blah do this}


This doesn't work however, obviously due to the fact that after a #, a command name or a number is expected. As the code shows, I'm trying to use the number within @blah as the needed value for #. Quick fix, anyone?

Thanks in advance.
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Tue Dec 09, 2008 4:46 pm   
 
~# maybe
_________________
Erasmus
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Tue Dec 09, 2008 5:14 pm   
 
With zMUD I'm fairly sure you can get away with #{@blah}
_________________
Taz :)
Reply with quote
Daarte
Beginner


Joined: 09 Jul 2008
Posts: 10

PostPosted: Wed Dec 10, 2008 5:05 am   
 
Neither way work, but thanks all the same. =]
Reply with quote
Tech
GURU


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

PostPosted: Wed Dec 10, 2008 8:47 am   
 
You're probably looking for the %exec function or #EXEC command.
_________________
Asati di tempari!
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Dec 10, 2008 12:46 pm   
 
# on it's own is just a shortened form of #LOOP so

#if (@blah > 0) {#loop @blah {do this}}

will work. Note the change of brackets on the logic part of the #IF you need to use round brackets not curly brackets.
_________________
Taz :)
Reply with quote
Daarte
Beginner


Joined: 09 Jul 2008
Posts: 10

PostPosted: Thu Dec 11, 2008 5:13 am   
 
Ah, great, second option works best for me, but thanks for namedropping %exec, that looks useful too.
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