! Teco initializer for starting up the H19 scope editor ! ! ! ! AUTHOR: Paul Mennen ! ! DATE: 03-Mar-84 ! ! ! ! unsquished version stored on: H19INI.TES ! ! squished version is stored on: H19INI.TEC (to use, must be renamed to TECO.INI) ! ! ! -1ES ! auto verify after search ! ^D 0ED ! set number base to decimal and set ED flag to zero ! 225,542ET ! set required bits in ET flag ! ! ET&1=0 (allow type out conversions) ET&2=1 (scope mode action for cntrl/u and delete) ! ! ET&32=0 (make ^T wait for character) ET&4=1 (read lower case) ! ! ET&64=0 (no meaning ???) ET&8=1 (read without echo) ! ! ET&128=0 (allow messages) ET&16=1 (cancel cntrl/O on type out) ! ! ET&512=1 (scope watch feature enabled) ! ! ! ! Set up macro in Q5 to type escape sequences ! ! The command XXXM5 will send an escape followed by the character whose ascii code is XXX ! ! e.g. ^^PM5 will send ESC P to the terminal ! ! ! @^U5/U9 0,1ET 27^T Q9^T 1,0ET/ ! save arg in Q9#, turn conversions off, type , conversions on ! ! ! ! Set up macro in Q6 to get a teco command or search argument from user ! ! Enter with the text for user prompt in Q4 ! ! Exit parameters: ! ! Q7#=-1(true) or 0(false) - true indicates valid user entry, this value is returned as the macro value ! ! Q4 - contains users response (including ESC ESC at end) ! ! ! @^U6/.U8 ZU4 -3U6 ! Q8#=current loc, Q4#=end of buffer, Q6#=-3 (counts altered lines) ! ^^HM5 ^^KM5 10^T ! type ESC H (home), type ESC K (erase 1st line), type LF ! ^^KM5 :G4 ! type ESC K (erase 2nd line), put Q4 text on 2nd line ! < ^TU7 !F! Q7^T ! get next character into Q7# and echo it ! ZJ Q7@I%% ! move to the end of buffer and insert character into text buffer ! Q7-10"E 13^T ^^KM5 -1%6 ' ! if Q7=LF type CR, ESC K (erase line), and decr Q6# (incr line count) ! Q7-21"E Q6^W 0U7 0; ' ! if Q7=^U, abort user entry, update all altered lines on screen ! Q7-127"E -D ! if Q7=Delete, delete preceeding character, then ! Z-Q4"N -1AU9 -D ! if not at end, get previous char into Q9# and delete it, then ! Q9-27"E 32U9 ' ! if Q9# was an escape, change it to a space ! Q9-31"G ^^DM5 ^^KM5 1+ ' 0"E ! if Q9# >= space, type ESC D ESC K (cursor left, erase line), and skip ! 13^T -Q6-2< ^^KM5 ^^AM5 > ! type CR, repeat ESC K ESC A (erase line, cursor up) for altered lines ! 10^T 13^T :G4 Q4,ZT ' ' ' ! type LF,CR type text in Q4, type buffer from Q4# to end ! Q7-27"E ^TU7 ! if Q7=ESC, get next caracter, then ! Q7-27"E !F0! 27@I%% Q4,ZX4 ! if Q7=ESC, put esc into buffer, put characters from Q4# to Z into Q4 ! ^^HM5 -1U7 0; ' ! type ESC H (home), set Q7#=true, exit loop ! Q7-^^?"E ^T^[ @O!F0! ' ! if Q7=? (any keypad key), discard character, treat as ESC ESC ! @O!F! ' > ! if it wasnt ESC ESC or keypad key, jump to F ! Q4,ZK Q8J Q7/ ! delete all added characters and restore pointer, return Q7# as value ! ! ! ! end of Q6 macro ! ! ! 0,0X3 0,0X7 0,0X9 ! empty Q3,Q7,Q9 (paste buffer, deleted text buffer, red key buffer ! 78U3 ! put default right margin position into Q3# ! G_ ^YX8 ^YK ! get last search string into buffer, put into Q8, then delete it ! 0,1ET 27^T 91^T 63^T 50^T 104^T 1,0ET ! send ESC [ ? 2 h to put terminal in VT-52 mode ! ^^HM5 ^^=M5 ^^uM5 -1W ! ESC H ESC = ESC u (home, alt keypad, unshifted keypad), refresh screen ! ^^YM5 54^T 32^T ^^JM5 ^^YM5 55^T 87^T ! clear space for help message at bottom of screen ! @^A%Type for help% ^^HM5 ! type help message, home cursor ! @EI%H19% ! start up the H19 scope editor (next line has two ESC's) !