A very simple way to check your code is to periodically ask the value of one
of both of the internal variables "RC" and "RESULT".
RC keeps track of all commands, functions both internal and external.
RESULT stores the message, the current host replied when sending a command.
The content of RESULT heavily depends on whom we talked to.
While RC always represents a positive numeric value of 0 or higher,
RESULT can store anything from numbers to strings to nothing.
To make use of RESULT, enable it by calling "Options RESULTS" before
results are received. Place on top of script for general purpose.
If RESULT wasn't returned the symbol becomes a string. E.g.:
Adress fcheck.1 Log
Logfile = RESULT /* assume result is a string like "20150701-1002-entry.45-kill"*/ then
Code:
Logfile = "20150701-1002-entry.45-kill"
But if addressed host is offline, or Options Results is not set ,
RESULT becomes a string itself
Never do a boolean check for RESULT !
Use 'Say rc' or 'Say result' to display them in current console, or redirect them
anywhere you like, e.g. in a log file, pipe, clipboard, conbuffer. Be more precise
and place a string as explanation next to it.
One or two return codes or results aren't big problem. 24 or hundreds of them
and you start pulling your hair