How do I setup an alias to call a script with a non predetermined number of wildcards? I can take the entire string of wildcards as one string and then tokenize that into individual words, but it seems like I am overdoing it then. I thought that the third argument to a script (from an alias was an array of the variables). But if I tell the alias to take three wild cards and I pass it three words it is fine. But 2 or 4 words bombs. Is there a simple way to do this or do I need to write my own sub function to figure out how many words are passed (through one wildcard) and then recurse the fxn as many times as needed (with the values). Ideally I want the script to work if I pass it one param or as many as 9 or 10.
Thanks for any help,
Tom
alias: test * * *
test values: test rhino pig mouse (works!)
test values: test rhino pig (no response)
test values: test rhino pig mouse dog (no response)
script: (below)
sub on_alias_test(strName, strThing, arrVars)
world.send "gt starting script"
dim intCounter
intCounter = 0
do while intCounter <=9
intCounter=intCounter+1
if arrvars(intcounter)<>"" then
world.send "gt var" & intCounter & " = " & arrvars(intcounter)
else
world.send "gt var" & intCounter & " is null"
end if
loop
world.send "gt made it to end of script."
end sub
sub
Thanks for any help,
Tom
alias: test * * *
test values: test rhino pig mouse (works!)
test values: test rhino pig (no response)
test values: test rhino pig mouse dog (no response)
script: (below)
sub on_alias_test(strName, strThing, arrVars)
world.send "gt starting script"
dim intCounter
intCounter = 0
do while intCounter <=9
intCounter=intCounter+1
if arrvars(intcounter)<>"" then
world.send "gt var" & intCounter & " = " & arrvars(intcounter)
else
world.send "gt var" & intCounter & " is null"
end if
loop
world.send "gt made it to end of script."
end sub
sub