|
Ayclaes Newbie
Joined: 31 Mar 2005 Posts: 9
|
Posted: 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. |
|
|
|
Ayclaes Newbie
Joined: 31 Mar 2005 Posts: 9
|
Posted: 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! |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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 |
|
|
|
|
|