%%HP: T(3)A(D)F(.);

@ read read.me first!!!

@ --------------------------------------------------------------------

@                                                        (c) VOIT 5'96

@ --------------------------------------------------------------------

@ SYNTAX:
@             1: <CODE>
@
@   Ex./BSP:  1: "CD.PLAY"

@ --------------------------------------------------------------------

@ This program is used by Alpha-IR for searching a Code in the Database.

@ --------------------------------------------------------------------

@ PRESUPPOSITIONS:

@  this file in HOME BATCHES
@  IRCODES also in HOME BATCHES

@ --------------------------------------------------------------------

\<<
  \-> str                 
    \<< OBJ\-> 1
      FOR idx str POS
        IF THEN
          idx             @ if the str was found...
          'result' STO    @ ...store it in 'result'
        END
        -1
      STEP
    \>>

  'result' VTYPE          @ exist 'result'?
  IF -1 ==             
  THEN
     0 'result' STO       @ if no, initialise with 0 and save it
  END

  erg                     @ read 'result'
                          @    1:0   -> not found in IRCODES
                          @    1:n   -> it's at position n in IRCODES
  'result' PURGE          @ delete 'result'
\>>


