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


Joined: 31 Mar 2005
Posts: 9

PostPosted: Fri Sep 23, 2005 10:35 pm   

Checking empty command line vars
 
Quick question - Is there a way to check if command line vars (%1...%99) are used in an alias?

I want to do this:
@char = John
#alias vig {#if (%1 = "") {cast vig @char} {cast vig %1}}

Any suggestions or a better way to do this would be appreciated.
Reply with quote
Ayclaes
Newbie


Joined: 31 Mar 2005
Posts: 9

PostPosted: Fri Sep 23, 2005 10:38 pm   
 
nm, got it.

#alias vig {#if (%1) {cast vig %1} {cast vig @char}}

I didn't know it was that simple. Thanks boards for helping me work it out!
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Sep 23, 2005 10:52 pm   
 
Simply using quotes around %1 will work, Also this is how I handle something like that

#ALIAS vig {
#IF (!%null("%1") {cast vig %1} {cast vig @char}
}

If its not empty cast it on %1, else cast it on @char
_________________
Zmud Support Library
Zmud Knowledge Base
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