Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!HAC2ARPA.HAC.COM!prshao From: prshao@HAC2ARPA.HAC.COM (Portia R. Shao) Newsgroups: comp.os.vms Subject: (none) Message-ID: <8808052226.AA00573@hac2arpa.hac.com> Date: 5 Aug 88 22:26:04 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 839 ...................... Cut between dotted lines and save ...................... $!.............................................................................. $! VAX/VMS archive file created by VMS_SHAR V-5.01 01-Oct-1987 $! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au) $! To unpack, simply save and execute (@) this file. $! $! This archive was created by PORTIA $! on Friday 5-AUG-1988 14:43:54.66 $! $! ATTENTION: To keep each article below 33792 bytes, this program $! has been transmitted in 2 parts. $! You should concatenate ALL parts to ONE file and execute (@) that file. $! $! It contains the following 3 files: $! EDTPLUS.KEYS EDTPLUS.1 EDTPLUS.2 $!============================================================================== $ Set Symbol/Scope=(NoLocal,NoGlobal) $ Version=F$GetSYI("VERSION") ! See what VMS version we have here: $ If Version.ges."V4.4" then goto Version_OK $ Write SYS$Output "Sorry, you are running VMS ",Version, - ", but this procedure requires V4.4 or higher." $ Exit 44 $Version_OK: CR[0,8]=13 $ Pass_or_Failed="failed!,passed." $ Goto Start $Convert_File: $ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd $No_Error1: Define/User_Mode SYS$Output NL: $ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' - VMS_SHAR_DUMMY.DUMMY f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f); o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o); Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V"; Move_Vertical(1);x:=Erase_Character(1);Append_Line; Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1); ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1); If Current_Character='`' then Move_Horizontal(1);else Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit; $ Delete VMS_SHAR_DUMMY.DUMMY;* $ Checksum 'File_is $ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR $ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd $No_Error2: Return $Start: $ File_is="EDTPLUS.KEYS" $ Check_Sum_is=1013541489 $ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY XEDTPLUS.KEYS definition for version 2.7 as of 3-AUG-1988 14:37:20.32 X X GOLD key functions are shown on the second line. V _______________________ _______________________________ X V To get help on | HELP | Do | |SorReSe|WriReSe|VasSpIn| X| V commands, type |KeyDefs| | | | | | X| V a command or ? |_______|_______________| |_______|_______|_______|_______ X| V and press _______________________ _______________________________ X V RETURN. | Find |Ins Her|Remove | | Gold |Dis CLN|FndNxt | Del L X| V |Wil Fin|Restore|Sto Tex| | key |Ins Dat| Find |Res Lin X| V For a list of |_______|_______|_______| |_______|_______|_______|_______ X| V all key defini- |Select |Pre Scr|Nex Scr| |MovByPa| Sect |Cop SRT| Del W X| V tions, type | Reset | | | | Do | Fill |Put COP|Res Wor X| V KEYS and press |_______|_______|_______| |_______|_______|_______|_______ X| V RETURN, or press |Move up| |Forward|Reverse|Remove | Del C X| V GOLD/HELP. |Mov CLT| |Bottom | Top |Ins Her|Res Cha X| V _______|_______|_______ |_______|_______|_______|_______ X| V To show a key |Mov Lef|Mov Dow|Mov Rig| | Word | EOL | Char | X| V definition, use |Shi WLB|Mov CLT|Shi WRB| |Swi Cas|Del EOL|Spe Ins| X| V SHOW KEY. |_______|_______|_______| |_______|_______|_______|Return X| V | Line |Select | Subs X| V Use the DO key to enter | Open Line | Reset | X| V advanced commands |_______________|_______|_______ X| X X V Key Function Gold sequence Function X V (GOLD = PF1) X V CTRL/A Insert overstrike X V CTRL/B Recall GOLD/CTRL/F Filter region X V CTRL/E End of line GOLD/TAB Toggle window width betw Xe V CTRL/H Start of line GOLD/CTRL/N Narrow region X V TAB Tab GOLD/CTRL/W Widen region X V CTRL/J Delete previous word GOLD/# Goto line specified X V CTRL/K Learn GOLD/& Tab stops X V CTRL/L Insert page break GOLD/( Copy rectangle X V RETURN Return GOLD/) Pasteover rectangle X V CTRL/R Refresh screen, keep mes GOLD/+ Split current window in X2 V CTRL/U Delete start line GOLD/- Unmap current window X V CTRL/V Quote GOLD/. Mark corner of rectangle X V CTRL/W Refresh GOLD/0 Repeat X V CTRL/Z Exit GOLD/1 Repeat X V DELETE Delete GOLD/2 Repeat X V UP Move up GOLD/3 Repeat X V DOWN Move down GOLD/4 Repeat X V RIGHT Move right GOLD/5 Repeat X V LEFT Move left GOLD/6 Repeat X V ENTER Return GOLD/7 Repeat X V PF2 Display current line num GOLD/8 Repeat X V PF3 Fndnxt GOLD/9 Repeat X V PF4 Del l GOLD/< Extract/remove rectangle X V COMMA Del c GOLD/= Save current location X V MINUS Del w GOLD/> Insert rectangle X V PERIOD Select GOLD/? Display row,column X V KP0 Line GOLD/A Show ascii table X V KP1 Word GOLD/B Goto buffer in current w Xi V KP2 Eol GOLD/C Use current window to di Xs V KP3 Char GOLD/D Do dcl command X V KP4 Forward GOLD/E Exit X V KP5 Reverse GOLD/F Visit file in another wi Xn V KP6 Remove GOLD/G Enlarge current window b Xy V KP7 Move by page GOLD/H Display comment on key d Xe V KP8 Sect GOLD/I Include file before curr Xe V KP9 Copy selected range to p GOLD/J Format mail reply/signat Xu V FIND Find GOLD/K Indent region selected X V INSERT HERE Insert here GOLD/L List buffers X V REMOVE Remove GOLD/M Return to main buffer X V SELECT Select GOLD/N Next window X V PREV SCREEN Previous screen GOLD/O Make this the only windo Xw V NEXT SCREEN Next screen GOLD/P Previous window X V F10 Exit GOLD/Q Quit X V F11 Forward reverse GOLD/R Replace string X V F12 Start of line GOLD/S Shrink current window by X V F13 Delete previous word GOLD/T Transpose two characters X V F14 Insert overstrike GOLD/U Update all modified file Xs V HELP Help keypad GOLD/V Visit another file reado Xn V DO Do GOLD/W Write out current buffer X V F17 Sort region selected GOLD/X Execute learn sequence X V F18 Write region selected GOLD/Z Attach to parent process X V F19 Vassar speller interface GOLD/[ Start learn sequence X V M1DOWN Position cursor to mouse GOLD/] End learn sequence X V M1UP Position cursor to mouse GOLD/^ Goto saved location X V M2DOWN Scroll text up GOLD/UP Move current line to top X V M2UP Stop scroll up GOLD/DOWN Move current line to bot Xt V M3DOWN Scroll text down GOLD/RIGHT Shift window right by nu Xm V M3UP Stop scroll down GOLD/LEFT Shift window left by num Xb V GOLD/ENTER Subs X V GOLD/PF2 Insert date/time X V GOLD/PF3 Find X V GOLD/PF4 Restore line X V GOLD/COMMA Restore char X V GOLD/MINUS Restore word X V GOLD/PERIOD Reset X V GOLD/KP0 Open line X V GOLD/KP1 Switch case X V GOLD/KP2 Del eol X V GOLD/KP3 Special insert X V GOLD/KP4 Bottom X V GOLD/KP5 Top X V GOLD/KP6 Insert here X V GOLD/KP7 Do X V GOLD/KP8 Fill X V GOLD/KP9 Put contents of pick buf Xf V GOLD/FIND Wildcard find X V GOLD/INSERT HERE Restore X V GOLD/REMOVE Store text X V GOLD/SELECT Reset X V GOLD/F13 Restore word X V GOLD/HELP Help keys X X $ GoSub Convert_File $ File_is="EDTPLUS.1" $ Check_Sum_is=3476900 $ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY X!------------------------ start of edtplus.tpu ----------------------------- X!++ X! FACILITY: X! Text Processing Utility (VAXTPU) X! X! ABSTRACT: X! This is the VAXTPU source program for the EDTplus emulator interface X! rewritten in VMS 5 based on the new and better EVE X! X! compile this by X! EDIT/TPU/SECTION=EVE$SECTION/NODISPLAY/Command=EDTPLUS.TPU X! then invoke TPU by X! EDIT/TPU/SEC=yourdir:EDTPLUS filename X! X! ENVIRONMENT: X! VAX/VMS (VMS 5.0) X! X! CREATION DATE: 16-Oct-1985 original version - Portia R. Shao X! MODIFICATIONS: 22-Oct-1985 do not map more than one DCL window X! 26-Nov-1985 ask for alternate file name if can't write X! in write_current_buffer X! 18-Feb-1986 fix end-of range for 1 character range in X! replace X! 16-May-1986 added rectangular cut and paste - Fred Kamgar X! 10-Jul-1986 added option to display line # at - FK X! 23-Jul-1986 added mark checking in rectangular cut - FK X! 06-Feb-1987 added untab, redefine_tab, better scolling X! using kp8, etc - PRS X! 16-Apr-1987 modified Gold-W to ask for file name - PRS X! 23-Jun-1987 replaced list_buffers -Dave S. Wallace X! 06-Jul-1987 modified do_dcl_command with $set noon -PRS X! 31-May-1988 modified checking for mark_1 to work for X! VMS 5, also modified EDTSESCINI for EDT$X_WORD X! so KP1 skips properly - PRS X! 1-AUG-1988 19:06:38.58 version 2.6. X! major rewrite for VMS 5: - PRS X! use as much of the EVE built-in functions X! as possible, and take advantage of the X! GREAT new features: i.e. wildcard, help. X! we get EVE's wildcard find for free X! we also get the help for free, PF2 now gives V! our definitions of keys, then type KEYS to ge Xt X! the list of all of current keys defined!! X! customizable eve$add_word_separators in X! tpu$local_init X! insert date/time by a key X! narrow/widen-region ala Emacs X! sort/indent/write/filter a selected region X! mail/reply reformat/insert signature X! added VAXstation mouse support X! interface to Vassar spell X! 3-AUG-1988 13:36:26.34 version 2.7 -PRS X! fixed rectangluar cut/past so it works when X! screen is shifted over X! define PF2 to show current line number instead X! of using Ctrl-n X! and Gold-PF2 to insert current date/time X! instead of Ctrl-d X! do not use ^f as wildcard find, use Gold-find X! X! unchanged behavior from previous version of EDTPLUS are simply listed, X! modified/new behavior is prefixed with * X! X! keys are grouped by functions (gold key is PF1) X! (files) X! gold c - change the current window to edit another file X! gold f - split screen and put another file in current window X! gold i - insert a file before current line X! gold u - update all modified files to disk X!*gold v - split screen and put another file in current window in READONLY mode X! the new window is UNMODIFIABLE, you can't even type into it, but X! you may cut (i.e. copy) out of it X!*gold w - write current buffer out to specified file X! X! (buffers) X! gold b - goto buffer named X!*gold l - list buffers so you can pick which one to go to or remove V! gold m - goto buffer called MAIN, the first buffer, for compatibility with ED XT X! X! (windows) X!*gold g - grow window height by number of lines specified X!*gold s - shrink window height by number of lines specified X! gold n - next window X! gold p - previous window X! gold o - make this the only window X! gold UP - goto top of buffer or make current line top line of window V! gold DOWN - goto bottom line of buffer or make current line bottom line of wi Xndow X! gold RIGHT - shift window to the left number of columns specified X! gold LEFT - shift window to the right number of columns specified X! gold + - split current window in half X! gold - - delete current window X! gold TAB - toggle screen width between 80 and 132 columns X! X! (editing) X! gold PF3 - find string X! PF3 - find next (regular or wildcard find) X!*gold find - wildcard find string X! ctrl a - toggle between insert and overstrike mode X! gold r - replace a string with another, with confirm X!*gold t - transpose current and previous character, works across line boundary X! ctrl v - quote (insert) the next character X! 3 (on keypad) - insert ASCII character in decimal X! 9 (on keypad) - Pick range without erasing it, placing it in PICK buffer X! gold 9 (on keypad) - insert the PICK buffer at current position X! gold . - mark corner of rectangle (use keyboard period, not keypad) X! gold < - extract rectangle of text X! gold > - insert rectangle of text here X! gold ( - copy rectangle of text X! gold ) - overlay rectangle of text X! X! (misc) X!*M1 - positions the cursor in where the mouse is, WARNING: X! M1 positions over null text pads the line if you use arrow keys X! to move it from the null position. No padding happens if you just X! click the mouse to another position. X!*M2 - hold down to scroll text up, release to stop X!*M3 - hold down to scroll text down, release to stop X!*gold PF2 - insert current date/time at cursor location X! gold d - do DCL command, output of command will goto DCL buffer X! gold q - quit, reconfirm if there are modified buffers X! gold e - exit editor, and save all modifed buffers, except read-only buffers X! gold z - attach to parent process (only if KeptTPU is used) X! gold h - help on key definitions X! gold a - show ASCII table X! gold ? - display current row and column on the screen (not in file) X! gold & - set tab stops, can set either interval (if only one number is X! entered) or actual tab stop setting. X!*PF2 - display current line number (this replaces the Help key many people X! hit by mistake.) X!*ctrl n - not used, this used to display what line # we are at X! gold # - goto line number specified X! gold = - save current cursor position X! gold ^ - return to saved current cursor position X! gold [ - start remembering keyboard learn sequence (keyboard macro) X! gold ] - end remembering keyboard learn sequence (keyboard macro) X! gold x - execute keyboard learn sequence (keyboard macro) X! ctrl r - refresh screen withour erasing messages buffer X! ctrl w - refresh screen, erase messages buffer X!*f17 - sort selection, you specify qualifier for the sort command X!*gold j - put > in front of every line and insert signature for mail reply X!*gold k - indent selected region by number of spaces specifed (left or right) X!*gold ctrl-n - narrow region, move selected text to another buffer for work X!*gold ctrl-w - widen region, move narrow region back in its original position X!*gold ctrl-f - filter region, filters the selection to a dcl command as input X! must specify sys$input and sys$output as input and output X!*f17 - sort region selected, can specify any valid sort qualifier X!*f18 - write region selected to a file as specified X!*f19 - run selection (or entire buffer) through Vassar speller, must do X! save in speller to get the results back (SPELL must be defined X! system-wide in dcltables.exe X! X! functions not bound to keys: X! - USE_EVE_KEYS to get vanilla eve keys X! - USE_EDTPLUS_KEYS to get edtplus definitions back X! - UNTAB to convert all tabs from cursor to end of file to number of spaces X! defined by current tab setting X! - REDEFINE_TAB redefines the tab key, so the right number of spaces are X! inserted when you hit the TAB key. You can put this in TPU$COMMAND if X! you want this as default, or add it to tpu$local_init in this file. X! X! more things to do in the future? X! - paren matching, begin-end matching X! X!-- X! Xprocedure vassar_spell X! modified eve version of spell X! SPELL.CLD must be set in the default dcltables.exe for this to work, X! since it uses the SPAWN command to interface to SPELL Xlocal selected_region, text_ptr, X start_mark, X end_mark, X the_file, X the_position, X is_offset; X Xon_error X [TPU$_CONTROLC]: X set (SCREEN_UPDATE, ON); X eve$learn_abort; X abort; X [TPU$_CREATEFAIL]: X eve$message (EVE$_CANTCREASPELL); X eve$learn_abort; X return (FALSE); X [OTHERWISE]: X set (SCREEN_UPDATE, ON); Xendon_error; X X selected_region := eve$selection (TRUE); X if selected_region = 0 then X message('Using entire buffer'); X text_ptr := current_buffer; X else X text_ptr := selected_region; X endif; X X if (get_info(the_filter_buffer,'type') <> BUFFER) then X the_filter_buffer := create_buffer('the_filter_buffer'); X endif; X if (get_info (filter_process, "type") = UNSPECIFIED) or X (filter_process = 0) X then X filter_process := create_process (the_filter_buffer, "$ set noon"); X endif; X send ("$ delete:==delete", filter_process); ! disregard user symbols X X the_file := "sys$scratch:" +str(get_info(filter_process,"pid")) + ".tmp"; X set (SCREEN_UPDATE, OFF); X X! insure we do complete lines (otherwise single words selected in the middle of X! a line get read_file'd onto previous line, too nasty to prevent) X X if eve$x_select_position <> 0 X then X start_mark := beginning_of (text_ptr); X end_mark := end_of (text_ptr); X if get_info (start_mark, "offset") > 0 X then X position (start_mark); X position (LINE_BEGIN); X start_mark := mark (NONE); X endif; X if get_info (end_mark, "offset") > 0 X then X position (end_mark); X position (LINE_END); X end_mark := mark (NONE); X endif; X text_ptr := create_range (start_mark, end_mark, NONE); X endif; X X! write out temp file to be checked by Vassar spell X X write_file (text_ptr, the_file); ! should on_error return false? X X spawn ("SPELL " + the_file ); X X eve$x_select_position := 0; X the_position := beginning_of (text_ptr); X erase (text_ptr); X if (the_position <> beginning_of (current_buffer)) X then X move_horizontal (-1); X the_position := mark (NONE); X move_horizontal (1); X is_offset := 1; X endif; X X read_file (the_file); ! get corrected text X position (the_position); X if is_offset X then X move_horizontal (1); X else X position (beginning_of (current_buffer)); X endif; X send ("$ delete " + the_file + ";*", filter_process); X selected_region :=0; X set (SCREEN_UPDATE, ON); X refresh; X return (TRUE); X Xendprocedure; ! vassar_spell X! XProcedure narrow_region X!global wide_region_buffer, wide_region_buffer_name, narrow_region_buffer, X! wide_region_position Xlocal region_selected, narrow_region_buffer_name; X if (get_info(narrow_region_buffer,'type') <> BUFFER) X or (narrow_region_buffer = 0) then X wide_region_buffer := current_buffer; X wide_region_buffer_name := get_info(current_buffer,'name'); X narrow_region_buffer_name := '<'+wide_region_buffer_name+'>'; X narrow_region_buffer := create_buffer (narrow_region_buffer_name); X else X message('Narrow region already active'); X return(FALSE); X endif; X region_selected := eve$selection(TRUE); X if region_selected <> 0 then X wide_region_position := mark(none); X erase(narrow_region_buffer); X position(narrow_region_buffer); X move_text(region_selected); X map (current_window, narrow_region_buffer); X eve$update_status_lines; X update (current_window); X else X eve$learn_abort; X return (FALSE); X endif; XendProcedure; !narrow_region X! XProcedure widen_region X if (current_buffer <> narrow_region_buffer) then X message ('Current buffer is not the narrow region buffer'); X return (FALSE); X endif; X position(wide_region_position); X move_text(narrow_region_buffer); X map (current_window, wide_region_buffer); X eve$update_status_lines; X update (current_window); X delete (narrow_region_buffer); XendProcedure; !wide_region X! XProcedure mail_reply Xlocal nlines, insertion_point; X position(beginning_of(current_buffer)); X nlines := get_info(current_buffer,'record_count'); X loop X copy_text('>'); X eve$edt_line; X nlines := nlines -1; X exitif nlines = 0; X endloop; X move_horizontal(-1); X insertion_point := mark (none); X move_horizontal(1); X eve_include_file ('sys$login:signature.txt'); X position (insertion_point); X split_line; X return; XendProcedure; ! mail_reply X! X!Procedure match_paren X!endProcedure; ! match_paren X! XProcedure indent_region X!glocal the_region_buffer; XLOCAL selected_region, nlines, saved_pos, blanks, answer, nindent; X X blanks := ' '; X selected_region := eve$selection (TRUE); X if selected_region = 0 then X eve$learn_abort; X return (FALSE); X else X if (get_info(the_region_buffer,'type') <> BUFFER) then X the_region_buffer := eve$init_buffer('the_region_buffer',''); X endif; X answer :=read_line('Number of spaces to indent? (+ right/- left)'); X nindent := int(answer); X saved_pos :=mark(none); X erase(the_region_buffer); X position(beginning_of(the_region_buffer)); X move_text(selected_region); X position(beginning_of(the_region_buffer)); X nlines := get_info(the_region_buffer,'record_count'); X if nindent>0 then X loop X copy_text(substr(blanks,1,nindent)); X eve$edt_line; X nlines:=nlines -1; X exitif nlines = 0; X endloop; X else X loop X erase_character(-nindent); X eve$edt_line; X nlines:=nlines -1; X exitif nlines = 0; X endloop; X endif; X position(saved_pos); X move_text(the_region_buffer); X endif; XendProcedure ! indent_region X! XProcedure sort_region X! global the_filter_buffer, filter_process; XLOCAL selected_region, sort_command, sort_qualifier; X X selected_region := eve$selection (TRUE); X if selected_region = 0 then X eve$learn_abort; X return (FALSE); X else X if (get_info(the_filter_buffer,'type') <> BUFFER) then X the_filter_buffer := create_buffer('the_filter_buffer'); X endif; X if (get_info (filter_process, "type") = UNSPECIFIED) or X (filter_process = 0) X then X filter_process := create_process (the_filter_buffer, "$ set noon"); X endif; X sort_qualifier:=read_line('Enter sort qualifier or CR for default> '); X sort_command:='$sort ' + sort_qualifier + ' sys$input sys$output'; X send(sort_command, filter_process); X send(selected_region, filter_process); X send_eof(filter_process); X erase (selected_region); X selected_region := 0; X move_text(the_filter_buffer); X message ('region sorted.'); X return (TRUE); X X endif; X XendProcedure; ! sort_region X! XProcedure filter_region X! global the_filter_buffer, filter_process; XLOCAL selected_region, filter_command, fliter_qualifier; X X selected_region := eve$selection (TRUE); X if selected_region = 0 then X eve$learn_abort; X return (FALSE); X else X if (get_info(the_filter_buffer,'type') <> BUFFER) then X the_filter_buffer := create_buffer('the_filter_buffer'); X endif; X if (get_info (filter_process, "type") = UNSPECIFIED) or X (filter_process = 0) X then X filter_process := create_process (the_filter_buffer, "$ set noon"); X endif; X message('use sys$input and sys$output for input and output if any'); X filter_command :=read_line('Enter dcl filter command: '); X send(filter_command, filter_process); X send(selected_region, filter_process); X send_eof(filter_process); X erase (selected_region); X selected_region := 0; X move_text(the_filter_buffer); X message ('region filtered.'); X return (TRUE); X X endif; X XendProcedure; ! filter_region X! XProcedure write_region XLOCAL selected_region, filename; X X selected_region := eve$selection (TRUE); X if selected_region = 0 then X eve$learn_abort; X return (FALSE); X else X filename :=read_line('Enter filename to write to: '); X write_file (selected_region, filename); X return (TRUE); X X endif; XendProcedure; ! write_region X! XProcedure pick_range Xif current_buffer = eve$x_bufed_buffer Xthen X if eve$$bufed_remove X then X return (TRUE); X else X eve$learn_abort; X return (FALSE); X endif; Xendif; Xreturn (eve$$store_remove (pick_buffer,FALSE)); XendProcedure; !pick_range X! XProcedure put_range X if (beginning_of(pick_buffer)<>end_of(pick_buffer)) X then X copy_text(pick_buffer); X append_line; X endif; XendProcedure; !put_range X! XProcedure mark_it X mark_1:=mark(reverse); X col_1:=current_offset+1; XendProcedure; !mark_it X! XProcedure insert_rect XLOCAL col,counter,end_ins,extract_buff,ins_mark,llen,numlines,numlines_added, X start_ins,tabs,tabsearch,temp,tflag; X on_error X endon_error; X set (bell,all,on); X extract_buff:=eve$find_buffer("EXTRACT"); X if (extract_buff<>0) then X numlines:=get_info(extract_buff,"record_count"); X if (numlines<>0) then X col:=current_offset+1; X move_horizontal(1-col); X tflag:=0; ! flag to indicate inserting text at end of buffer X if (mark(none)=end_of(current_buffer)) then X tflag:=1; X split_line; X move_vertical(-1); X endif; X start_ins:=mark(none); X counter:=0; X numlines_added:=0; X loop X exitif (counter=numlines); X if (mark(none)=end_of(current_buffer)) then X split_line; X numlines_added:=numlines_added+1; X else X move_vertical(+1); X endif; X counter:=counter+1; X endloop; X end_ins:=mark(none); X if tflag=1 then X move_vertical(-1); X erase_line; X endif; X position(beginning_of(extract_buff)); X position(start_ins); X tabsearch:=search(ascii(9),forward); X if tabsearch=0 then X tabs:=0; X else X if beginning_of(tabsearch)>=end_ins then X tabs:=0; X else X tabs:=1; X endif; X endif; X if (tabs=0) then !no tabs in inserting range X counter:=0; X loop X exitif (counter=numlines); X llen:=length(current_line); X if (llen<(col-1)) then !extend line with blanks if necessary X move_horizontal(llen-get_info(current_buffer,"offset_column")+1); X nb:=(col-llen-1); X pad_w_nb_blanks; X else X move_horizontal(col-get_info(current_buffer,"offset_column")); X endif; X ins_mark:=mark(none); X position(extract_buff); X temp:=mark(none); X move_vertical(+1); X move_horizontal(-2); X ins_range:=create_range(temp,mark(none),none); X move_horizontal(+2); X position(ins_mark); X copy_text(ins_range); X move_vertical(+1); X counter:=counter+1; X endloop; X else X message('cannot insert because tabs are imbedded in the text'); X position(end_ins); X counter:=0; X loop ! delete extra lines added X exitif (counter=numlines_added); X move_vertical(-1); X erase_line; X counter:=counter+1; X endloop; X endif; X position(start_ins); X move_horizontal(col-1); X else X message("EXTRACT buffer empty"); X endif; X else X message("no data to insert"); X endif; X set (bell,all,off); X set (bell,broadcast,on); XendProcedure; !insert_rect $ GoSub Convert_File $ Goto Part2