/*

                        **************************
                        **** xFX ARexx script ****
                        **************************


                       ARexx command tester for xFX
*/


if ~show('P','xFX.1') then do  /* Check if xFX is running */
  say 'xFX not running !'
  exit
end

address 'xFX.1'
options prompt 'xFX> '
options results

say 'Type QUIT to exit.'

GoLabel:
  signal on Error
  signal on Syntax

  do forever
    parse pull command	/* get a command from the user	  */
    drop rc		/* clear out previous return code */
    drop result		/* clear out previous result	  */
    interpret command	/* execute the command		  */
    if upper(command) = 'QUIT' then exit
    say result
  end



Error:
Syntax:
  say 'ERROR:'
  say ' ARexx return code..' rc
  say ' ARexx message......' '"'errortext(rc)'"'
  say ' xFX message........' '"'xFX.LASTERROR'"'
  signal GoLabel
