I'm wondering if it's possible to do the following with ASPECT:
I want to be able to transmit "something^M" to a remote host and wait for a response.
When the response comes, if WAITFOR is 'foo', I want to call function foo. If WAITFOR is 'bar', I want to call function bar. If WAITFOR is anyting else, then display a msgbox and terminate the script. Something like this:
transmit "something^M"
if waitfor "foo" 5
;Call function foo
elseif waitfor "bar" 5
;Call function bar
else
usermsg "Unexpected value!"
exit
endif
I tried the above, and it doesn't seem to work. Though I can get the 'if waitfor' part to work, that can only tests for one possibility of waitfor - like "either waitfor is 'foo' or anything else', not "if wait for is 'foo', 'bar', or anything else".
Is it possible to test for mulitple WAITFOR responsees, or better yet, assign WAITFOR to a string and/or use it a switch statement?
One other thing about WAITFOR .. is it possible when I transmit "something^M" to make my script look for the very first response back from the remote host instead of having to wait for N seconds?
TIA
I want to be able to transmit "something^M" to a remote host and wait for a response.
When the response comes, if WAITFOR is 'foo', I want to call function foo. If WAITFOR is 'bar', I want to call function bar. If WAITFOR is anyting else, then display a msgbox and terminate the script. Something like this:
transmit "something^M"
if waitfor "foo" 5
;Call function foo
elseif waitfor "bar" 5
;Call function bar
else
usermsg "Unexpected value!"
exit
endif
I tried the above, and it doesn't seem to work. Though I can get the 'if waitfor' part to work, that can only tests for one possibility of waitfor - like "either waitfor is 'foo' or anything else', not "if wait for is 'foo', 'bar', or anything else".
Is it possible to test for mulitple WAITFOR responsees, or better yet, assign WAITFOR to a string and/or use it a switch statement?
One other thing about WAITFOR .. is it possible when I transmit "something^M" to make my script look for the very first response back from the remote host instead of having to wait for N seconds?
TIA