/*
 * $VER: ST2ImageFX.strx 1.0 (16.04.97) Waldemar Zöhner
 *
 * Requirements: ScanTek V3.0 or higher
 *               ImageFX 2.0 or higher
 *
 * Description:  Load the last scanned image direct into the main ImageFX
 *               buffer.
 *
 * Uses:         RC contains the Errorlevel of each ScanTek command
 *               SCANTEK.LASTERROR contains the related error string
 *               RESULT contains the result of some ScanTek command
 *
 */

Options FailAt 100

Options Results

ImageFXPort = LEFT(address(),17) == 'arexx_reply_port_'

Address SCANTEK1

  GetImageName

  IF rc > 0
   THEN
    DO
      say SCANTEK.LASTERROR
      EXIT
    END;

  say 'GetImageName Result is 'Result


IF ~ImageFXPort
 THEN
  Address IMAGEFX.1
 ELSE
  Address

  /* Load scanned image into ImageFX main buffer */
  LoadBuffer Result force

  Render Go

EXIT
