/* Opérateur de Sobel */

SIGNAL on ERROR
SIGNAL on SYNTAX
SIGNAL on BREAK_C

ADDRESS 'Lynx'
options results

CurrentImageName var nom
AddrCurrentImage var adresse
Convolve "Sobel_X"
AddrCurrentImage var sobelx
SelectImage nom
Convolve "Sobel_Y"
AddrCurrentImage var sobely
AddImage sobelx module
DeleteBuffer sobelx
DeleteBuffer sobely

LynxEnd

exit

ERROR:
  Select
   when RC = 3 then say "*** Error" RC" on line "SIGL": Process Failed"
   when RC = 2 then say "*** Error" RC" on line "SIGL": Invalid entries" 
   when RC = 1 then say "*** Error" RC" on line "SIGL": No image !"
   otherwise say "*** Error "RC" on line "SIGL
  end

  say "--> "SourceLine(SIGL)
  say
  say 'Press [RETURN]'
  pull
  LynxEnd
  exit

SYNTAX:
  say "*** Syntax error (Code "RC") on line" SIGL
  say "--> "SourceLine(SIGL)
  say
  say 'Press [RETURN]'
  pull
  LynxEnd
  exit

BREAK_C:
  say "User Abort"
  say "--> "SourceLine(SIGL)
  say
  say "Press [RETURN]"
  pull
  LynxEnd
  exit
  