$sw
Returns the value of a switch for an alias
|
Usage |
$sw(<switch_name>[,<long_switch_name>])
|
Description |
This function is valid and useful only in aliases.
It allows an alias to handle switches just like any other
KVIrc command. If a switch in the form -<letter> was
passed to the current alias then $sw(<letter>)
returns 1 (true). If a switch in the form -<letter>=<value>
was passed to the current alias then <value> is returned.
If the switch was not present at all then this function
returns an empty string (that evaluates to false in an expression).
A warning is printed if this function is used non-alias code.
|
Syntax Specification |
<variant> $sw(<switch_name:string>[,<long_switch_name:string>])
|
Examples |
alias(test){
if($sw(a,append)) echo "Switch -a was passed"
%x = $sw(x);
if(%x) echo "Switch -x=%x was passed"
}
test -a
test -x
test --append -x
test -a -x
test -a -x=test
test -a=10 -x=test
|
|
See also |
$insidealias
|