!lm10
!rm70
Applesoft Line Editing Aid..................Sandy Mossberg

[ Sandy is an M.D. in Port Chester, New York.  You have probably seen his excellent articles and programs in NIBBLE. ]

The following program is a developmental tool for line-editing Applesoft programs.  It places the line you specify at the top of the screen, ready to be cursor edited.  The line is displayed without added blanks at the end of each screen line, which can mess up editing of PRINT statements.  Obviously, adding Konzen-like PLE features would make it much nicer, but that's a story for another day.

The program loads at the ever-popular $300.  If you BRUN it, or BLOAD and CALL768, it installs itself.  To use it, type a slash and a line number.  For example, to edit line 150, type "/150" and a carriage return.  The screen will be cleared and line 150 displayed on the top.  The cursor will be placed over the first character, and you will be ready to edit it with standard cursor-editing techniques.  (If there is no line 150 in memory, the bell will ring instead.)

Several aspects of the code should be of interest to assembly language programmers:

!lm15
!rm65
(1) As noted in AAL of 9/81, the CHRGET/CHRGOT routine screens for the command character (a slash).  This technique permits concurrent use of an amper-utility.  The KSW hook could be employed as yet another filter, making a trio of vectors operative.

(2) To allow "illegal" line numbers (64000-65535) to be accessed, the LINGET routine is replaced by calls to FRMEVL and GETADR (see Lines 1800-1810).

(3) The de-parsing secton (see Lines 2030-2500) is an offspring of Applesoft's LIST routine, modified to pring a single program line rather than an entire listing.  I also eliminated the code which adds those extra blanks in the middle of quoted strings which take more than one screen line to LIST.  To me it seems pretty neat!
!lm10
!rm70

Since I did not make any test to determine whether or not the program is RUNning at the time the slash is trapped in my filter, you have to be careful about using the slash character in REM statements.  For example, "REM /150" will clear the screen and list line 150 at the top before proceeding.  Other combinations of "/" in REM's may blow up.  Also, typing "/" when Applesoft is executing an INPUT statement is now dangerous.  Anyone know how to fix this?
