I have a situation that I have to wait for either:
(1) "Press any key for more"
(2) "Command:?"
The problem is I don't know which on the above will arrive.
If I am using the 'when' command with 'target' then I can't
return the original caller. For example:
proc main
integer nRet
nRet = processText()
if nReturn == 1
termmsg "There are more"
elseif nReturn == 2
termmsg "Enter command now"
else
termmsg "Error - Invalid text received"
endif
endproc
func processText:integer
waitfor "Press any key for more"
if success
return 1
else
waitfor "Command:?"
if success
return 2
endif
endif
return 0
endfunc
If I use 'when' command inside the 'processText" function
then how do return to the 'main' ?
Thanks
(1) "Press any key for more"
(2) "Command:?"
The problem is I don't know which on the above will arrive.
If I am using the 'when' command with 'target' then I can't
return the original caller. For example:
proc main
integer nRet
nRet = processText()
if nReturn == 1
termmsg "There are more"
elseif nReturn == 2
termmsg "Enter command now"
else
termmsg "Error - Invalid text received"
endif
endproc
func processText:integer
waitfor "Press any key for more"
if success
return 1
else
waitfor "Command:?"
if success
return 2
endif
endif
return 0
endfunc
If I use 'when' command inside the 'processText" function
then how do return to the 'main' ?
Thanks