( FLIB - HP71 FORTH utilities) ( Tapani Tarvainen 85/05/17) BASE @ HEX : ?FORGET ( --; FORGET if exists) ( TT 85/04/19) BL WORD DUP ( save for FORGET) FIND IF DROP ( WORD result now on top) E5214 >R ( goes into middle of FORGET) ( probably won't work with other than FTH:1A) ELSE ( not found, just clean stack) 2DROP THEN ; : NTYPE ( str--; like TYPE but clears bit 7 of last char) ( and uses only 5 low bits of char count) 1F AND ?DUP IF 1- 2DUP TYPE 2* + C@ 7F AND EMIT ELSE DROP THEN ; ( EDIT - EDTEXT in FORTH) ( TT 85/05/03) 8 STRING EDITfile ( used to hold file name) : EDIT ( --- ; used in the form: EDIT name) ( if no name is given, old EDITfile contents are used) BL WORD COUNT ?DUP IF EDITfile S! ELSE DROP THEN EDITfile " EDTEXTFORTH$" BASICX ." save? Y/N" CR KEY 59 = IF EDITfile " COPYFORTH$TO:%16" BASICX THEN ." Quit Load Assemble?" CR KEY CASE 4C OF ." Loading..." EDITfile LOADF ENDOF 41 OF ." Listing? " QUERY BL WORD COUNT LISTING S! EDITfile ASSEMBLE ENDOF ENDCASE ; : BASICW ( str--; execute 2-part BASIC statement) ( 1st part in stack, 2nd from input stream - all of it) ( TT 85/05/16) 1 END$ ( move str to PAD, set maxlen to 80) X WORD ( X is no char so we get everything left) COUNT S<& BASICX ; ( the following are used just like in BASIC) : PURGE " PURGE" BASICW ; : CAT " CAT" BASICW QUIT ( so it'll remain in display) ; : LIST " LIST" BASICW ; : PLIST " PLIST" BASICW ; : COPY " COPY" BASICW ; BASE !