
IN is a programm for interactive input, like INPUT in BASIC or readln in 
Pascal. It gives back the input-string to the stack. If you press the INS-key,
you can do other things, like visit variables, and then continue the programm.
Insert the special characters ":" and "_" with my programm REPL (or with other
methods).


IN                                     ! remarks
<< -> s p
  << s "" <> s ":" + s IFTE 's' STO    ! If prompt-string then add a ":"
    WHILE 
      IFERR DO                         ! loop with pseudo-interrupt-handling
        s OVER +                       ! Add prompt-string
        "_" + p ->IN                   ! get char (cursor on)
        s OVER +                       ! Add prompt-string
        p ->IN                         ! get char (cursor off)
      UNTIL 0 END THEN END             ! end interrupt-loop
      DUP "ENTER" <>                   ! do not terminate IN ?
    REPEAT
      DUP "INS" ==                     ! if key INS is pressed
      << DROP2 LCD-> 'lcd' STO         ! save current screen
         HALT                          ! spawn 2nd process
         "" "" lcd ->LCD lcd PURGE >>  ! refresh screen
      IFT
      DUP "BACK" ==                    ! if the <- key is pressed
      << DROP 1 OVER SIZE 1 - SUB      ! delete last char
         "" >> IFT
      +                                ! add char
    END
    DROP DUP s SWAP + p DISP           ! display input-string without cursor
  >>
>>

->IN                                   ! sub-programm for blinking cursor
<< DISP                                ! display input-string
   1 40 START KEY                      ! loop for getting key to
     '->IN' IFT                        ! create an error for pseudo-interrupt-
   NEXT                                ! handling and resuming main-programm IN 
>>  


use:   2:        <prompt-string>
       1:  <display-line-number>
       IN


e.g.:  2:                "Value"
       1:                      3
       IN

or    << CLLCD "Value" 3 IN 'VALUE' STO >>

==>    +----------------------+
       |                      |
       |Value:_               |
       |                      |
       |                      |
       +----------------------+


+------------------------------------------------------------------+
! true name: Ulli Horlacher *     e-mail: framstag@dtupev5a.bitnet !
! nick name: Framstag       *             s_horlac@dulruu51.bitnet !
!      or    Fraturday      * snail-mail: Ulli Horlacher           !
!                           *             Landfriedbuehl 5         !
! Universitaet Ulm          *             D-7900 Ulm               !
! West-Germany              *             West-Germany             !
!******************************************************************!
!                 "Murphy was an optimist"                         !
+------------------------------------------------------------------+
