[comp.sys.apple] Input Anything from ProDOS

McAllister@DOCKMASTER.ARPA (08/03/88)

Date:03 Aug 88, 0700 edt
From: Richard McAllister<McAllister at DOCKMASTER.ARPA>
Subject:Input Anything from ProDOS

Tom Metro writes:

> Here is a routine I found on a local BBS that worked great. Fast and
> disk access compatable:

> -----------
> Here's a little one, which comes from The Applesoft Ref. Man.:

> 60000 IN$ = "X": REM IN$ must be the first variable defined in the program
> 60010 FOR I = 768 TO 790: READ ML: POKE I,ML: NEXT
> 60020 DATA  162, 0, 32, 117, 253, 160, 2, 138, 145, 105, 200, 169, 0,
>             145, 105, 200, 169, 2, 145, 105, 76, 57, 213
> 60030 RETURN

> To use this routine, start the program with:
> 10  GOSUB 60000
> And when you want to get an INPUT:
> 100 Call 768: REM Get input
> 110 IN$ = MID$(IN$,1):  REM Don't leave this out

> --------------

The ML routine here uses NXTCHAR ($FD75) in the monitor.  I recommend a
better routine which uses the GOSYSTEM ($BE70) routine on the
BASIC INTERPRETER global page. All is the same except:

60010 FOR I =768 TO 796: READ ML:POKE I,ML:NEXT
60020 DATA 169,202,32,112,190,176,19,174,219,190,202,160,2,138,
           145,105,200,169,0,145,105,200,169,2,145,105,96,76,9,190

The advantages are speed, no display/cursor interference, and if you
like, knowledge of the string length found by:

              X=2+PEEK(105)+256*PEEK(106)
              L=PEEK(X)

The string will be up to 239 characters unless sooner terminated
by a carriage return.

This ML routine eliminates a lot of complexity in reading ProDOS
text files.  WARNING: The BASIC portion of this method comes from
a copywrited APPLE manual as referenced.
***** NOTE ******
 The routine is only for disk input not keyboard