home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-04 | 41.0 KB | 1,479 lines |
- $MACRO_FILE SUPPORT;
- {******************************************************************************
- MACRO FILE SUPPORT
-
- LINEDRAW - Line and box drawing
- ASCII - ASCII table
- CONDENSE - Condensed display
- SQUEEZE - Convert tabs to spaces, or vice versa
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
-
- $MACRO LINEDRAW TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: LINEDRAW
-
- Description: This macro allows the user to draw the single and double line
- characters using the arrow keys to create lines and boxes etc.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- {
- Here is a list of all of the linedrawing characters:
- │┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌
- }
- { Define variables }
-
- Def_Char(U_Char,D_Char,L_Char,R_Char);
- Def_Int(Temp_Integer,Present_Direction,A_Left,A_Right,A_Up,A_Down,Shift_Stat,
- Draw_Mode,Temp_Insert,D_Mode,U_Mode,L_Mode,R_Mode,Temp_Tab_Expand,K1,
- K2);
-
- { Store current status of certain stuff so we can restore it upon exit. }
- Temp_Insert := INSERT_MODE;
- Insert_Mode := False;
- Temp_Tab_Expand := Tab_Expand;
- Tab_Expand := False;
- Undo_Stat := False;
- Push_Labels;
- refresh := TRUE;
- Redraw;
- { Initialize variables }
-
- Present_Direction := 0;
- A_Left := 1;
- A_Right := 2;
- A_Up := 3;
- A_Down := 4;
-
- Draw_Mode := 1;
- MAKE_MESSAGE('SINGLE LINE: |26 = move, Shift |26 = draw, F2 = ╬, Esc = quit.');
- FLABEL('Double',2,$FF);
- Goto WAIT_FOR_KEYPRESS;
-
- GO_LEFT:
- Left;
-
- WAIT_FOR_KEYPRESS:
- READ_KEY;
-
- GET_KEY_CODES:
- K1 := Key1;
- K2 := Key2;
- loopxxx:
- {This is to take care of key type ahead filling up the buffer}
- IF (Check_Key) THEN
- IF (key1 = k1) AND (key2 = k2) THEN
- goto loopxxx;
- ELSE
- push_key(key1,key2);
- END;
- END;
- {This Shift_Stat stuff is kind of a kludge to work with extended keyboard. It
- is possible that this will not work properly 100% of the time}
- R_AX := $0200;
- INTR($16);
- Shift_Stat := ((R_AX and $0003) > 0);
- Insert_Mode := False;
-
- If (K1 = 27) Then
- Make_Message('');
- Goto END_OF_MAC; { If so, then user pressed <ESC> so...}
- End;
- IF K2 = 59 THEN
- Help('LD');
- END;
- IF K2 = 60 THEN
- IF (Draw_Mode < 3) THEN
- ++Draw_Mode;
- Else
- Draw_Mode := 1;
- END;
-
- MAKE_MESSAGE(Copy(
- 'SINGLE LINE: |26 = move, Shift |26 = draw, F2 = ╬, Esc = quit. DOUBLE LINE: |26 = move, Shift |26 = draw, F2 = erase, Esc = quit.ERASE: |26 = move, Shift |26 = erase, F2 = ┼, Esc = quit. '
- ,((Draw_Mode - 1) * 68) + 1,68));
- FLABEL(Copy('DoubleErase Single',((Draw_Mode - 1) * 6) + 1,6),2,$FF);
- Goto WAIT_FOR_KEYPRESS;
- END;
-
- IF (K2 = 73) THEN
- Page_Up;
- End;
-
- IF (K2 = 81) THEN
- Page_Down;
- End;
-
- IF (K2 = 71) THEN
- Home;
- End;
-
- IF (K2 = 79) THEN
- Eol;
- End;
-
- {We translate mouse cursor key codes up here to simplify things down there}
- IF (K2 > 239) THEN
- IF (K2 = 240) THEN
- K2 := 72;
- END;
- IF (K2 = 241) THEN
- K2 := 80;
- END;
- IF (K2 = 242) THEN
- K2 := 75;
- END;
- IF (K2 = 243) THEN
- K2 := 77;
- END;
- END;
-
- IF (K2 = 77) Then {Right arrow}
- If c_col > 252 Then {Don't allow cursor to wrap down}
- Goto WAIT_FOR_KEYPRESS;
- End;
- If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move right}
- Right;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If ((K1 = 54) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
- IF (Draw_Mode = 3) THEN
- Text(' ');
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If Present_Direction = A_Right Then {If we were previously going a
- different direction, then insert char at current cusror position. Otherwise,
- insert char in the next right position}
- Right;
- End;
- Present_Direction := A_Right;
- Call LOOK_AROUND;
-
- Temp_Integer := XPos(L_Char,'┐╖╕╗┘╛╜╝┤╢╣╡',1);
- If (Temp_Integer) Then
- Left;
- Text(Copy('┬╥┬╥┴┴╨╨┼╫╫┼╦╦╤╦╩╧╩╩╬╬╬╪',((Draw_Mode - 1) * 12) + Temp_Integer,1));
- Goto GO_LEFT;
- End;
-
- If ((L_Mode > 0) and ((D_Mode + U_Mode + R_Mode) = 0)) Then
- Text(Copy('─═',Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((D_Mode = 1) And (U_Mode = 1)) Then
- Text(Copy('├╞├╞╞╠├╞┤╣┼╬┤╣├╞╡╡╡╡╪╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((D_Mode = 2) And (U_Mode = 2)) Then
- Text(Copy('╟╠╟╠╟╠╟╠╢╣╫╬╢╠╟╠┤╣┤╣┼╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (D_Mode = 1) Then
- Text(Copy('┌╒┌╒┐╕┌╒┐╗┬╦┐╗┌╒┐╕┌╕┬╤',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (D_Mode = 2) Then
- Text(Copy('╓╔╓╔╓╔╓╔╖╗╥╦╖╗╓╔╖╗╓╗╥╦',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (U_Mode = 2) Then
- Text(Copy('╙╚╙╚╙╚╙╚╜╝╨╩╜╝╙╚╜╝╙╝╨╩',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (U_Mode = 1) Then
- Text(Copy('└╘└╘┘╛└╘┘╝┴╩┘╝└╘┘╛└╛┴╧',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- {If no other condition exists...}
- Text(Copy('─═',Draw_Mode,1));
- Goto GO_LEFT;
- END;
- END;
-
- IF (K2 = 75) Then {Left arrow}
- If c_col = 1 Then {Don't allow cursor to wrap up}
- Goto WAIT_FOR_KEYPRESS;
- End;
- If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move left}
- Left;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If ((K1 = 52) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
- IF (Draw_Mode = 3) THEN
- Text(' ');
- Left;
- Left;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If Present_Direction = A_Left Then {If we were previously going a
- different direction, then insert char at current cusror position. Otherwise,
- insert char in the next left position}
- Left;
- End;
- Present_Direction := A_Left;
- Call LOOK_AROUND;
-
- Temp_Integer := XPos(R_Char,'┌╓╒╔└╘╙╚├╟╠╞',1);
- If (Temp_Integer) Then
- Right;
- Text(Copy('┬╥┬╥┴┴╨╨┼╫╫┼╦╦╤╦╩╧╩╩╬╬╬╪',((Draw_Mode - 1) * 12) + Temp_Integer,1));
- Goto GO_LEFT;
- End;
-
- If ((R_Mode > 0) and ((D_Mode + U_Mode + L_Mode) = 0)) Then
- Text(Copy('─═',Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((D_Mode = 1) And (U_Mode = 1)) Then
- Text(Copy('┤╡├╠╞╞┤╡┤╡┼╬┤╞┤╡╡╣├╠╪╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
-
- If ((D_Mode = 2) And (U_Mode = 2)) Then
- Text(Copy('╢╣╟╠├╠╢╣╢╣╫╬├╠╢╣╢╣╟╣┼╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (D_Mode = 1) Then
- Text(Copy('┐╕┌╔┌╒┐╕┐╕┬╦┐╒┐╕┌╒┌╔┬╤',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (D_Mode = 2) Then
- Text(Copy('╖╗╓╔╓╔╖╗╖╗╥╦╖╔╖╗╖╗╓╔╥╦',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (U_Mode = 2) Then
- Text(Copy('╜╝╙╚╙╚╜╝╜╝╨╩╜╚╜╝╜╝╙╚╨╩',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (U_Mode = 1) Then
- Text(Copy('┘╛└╚└╘┘╛┘╛┴╩┘╘┘╛┘╛└╚┴╧',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- {If no other condition exists...}
- Text(Copy('─═',Draw_Mode,1));
- Goto GO_LEFT;
- END;
- END;
-
- IF (K2 = 72) Then {Up arrow}
- If C_Line = 1 Then
- Goto WAIT_FOR_KEYPRESS;
- End;
- If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move left}
- Up;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If ((K1 = 56) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
- IF (Draw_Mode = 3) THEN
- Text(' ');
- Left;
- Up;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If Present_Direction = A_Up Then {If we were previously going a
- different direction, then insert char at current cusror position. Otherwise,
- insert char in the next left position}
- Up;
- End;
- Present_Direction := A_Up;
- Call LOOK_AROUND;
-
- Temp_Integer := XPos(D_Char,'┐╕╖╗┌╓╒╔┬╤╦╥',1);
- If (Temp_Integer) Then
- Down;
- Text(Copy('┤╡┤╡├├╞╞┼╪╪┼╣╣╢╣╠╟╠╠╬╬╬╫',((Draw_Mode - 1) * 12) + Temp_Integer,1));
- Goto GO_LEFT;
- End;
-
- If ((D_Mode > 0) and ((R_Mode + U_Mode + L_Mode) = 0)) Then
- Text(Copy('│║',Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((L_Mode = 1) And (R_Mode = 1)) Then
- Text(Copy('┴╨┬╦╥╥┴╨┴╨┼╬┴╥┴╨╨╩┬╦╫╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((L_Mode = 2) And (R_Mode = 2)) Then
- Text(Copy('╧╩╤╦┬╦╧╩╧╩╪╬┬╦╧╩╧╩╤╩┼╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (L_Mode = 1) Then
- Text(Copy('┘╜┐╗┐╖┘╜┘╜┤╣┘╖┘╜┘╜┐╗┤╢',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (L_Mode = 2) Then
- Text(Copy('╛╝╕╗╕╗╛╝╛╝╡╣╛╗╛╝╛╝╕╗╡╣',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (R_Mode = 2) Then
- Text(Copy('╘╚╒╔╒╔╘╚╘╚╞╠╘╔╘╚╘╚╒╔╞╠',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (R_Mode = 1) Then
- Text(Copy('└╙┌╔┌╓└╙└╙├╠└╓└╙└╙┌╔├╟',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- {If no other condition exists...}
- Text(Copy('│║',Draw_Mode,1));
- Goto GO_LEFT;
- END;
- END;
-
- IF (K2 = 80) Then {Down arrow}
- If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move right}
- Down;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If ((K1 = 50) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
- IF (Draw_Mode = 3) THEN
- Text(' ');
- Left;
- Down;
- Present_Direction := 0;
- Goto WAIT_FOR_KEYPRESS;
- END;
- If Present_Direction = A_Down Then {If we were previously going a
- different direction, then insert char at current cusror position. Otherwise,
- insert char in the next right position}
- Down;
- End;
- Present_Direction := A_Down;
- Call LOOK_AROUND;
-
- Temp_Integer := XPos(U_Char,'┘╛╜╝└╙╘╚┴╧╩╨',1);
- If (Temp_Integer) Then
- Up;
- Text(Copy('┤╡┤╡├├╞╞┼╪╪┼╣╣╢╣╠╟╠╠╬╬╬╫',((Draw_Mode - 1) * 12) + Temp_Integer,1));
- Goto GO_LEFT;
- End;
-
- If ((U_Mode > 0) and ((R_Mode + D_Mode + L_Mode) = 0)) Then
- Text(Copy('│║',Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If ((L_Mode = 1) And (R_Mode = 1)) Then
- Text(Copy('┬╥┬╥╥╦┬╥┴╩┼╬┴╩┬╥╨╨┬╨╫╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
-
- If ((L_Mode = 2) And (R_Mode = 2)) Then
- Text(Copy('╤╦╤╦╤╦╤╦╧╩╪╬╧╦╤╦┴╩┴╩┼╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (L_Mode = 1) Then
- Text(Copy('┐╖┐╖┐╖┐╖┘╝┤╣┘╝┐╖┘╜┐╜┤╢',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (L_Mode = 2) Then
- Text(Copy('╕╗╕╗╕╗╕╗╛╝╡╣╛╝╕╗╛╝╕╝╡╣',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (R_Mode = 2) Then
- Text(Copy('╒╔╒╔╒╔╒╔╘╚╞╠╘╚╒╔╘╚╒╚╞╠',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- If (R_Mode = 1) Then
- Text(Copy('┌╓┌╓┌╓┌╓└╚├╠└╚┌╓└╙┌╙├╟',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
- Goto GO_LEFT;
- End;
-
- {If no other condition exists...}
- Text(Copy('│║',Draw_Mode,1));
- Goto GO_LEFT;
- END;
- END;
-
-
- {*****************************************************************************}
- Goto WAIT_FOR_KEYPRESS;
-
-
- LOOK_AROUND:
- { This subroutine looks at all chars surrounding CUR_CHAR and stores special
- values into variables based on what it finds }
-
- If (((C_Row + 2) > Win_Y1) And ((C_Row + 4) < Win_Y2)) Then
- Refresh := False;
- End;
-
- If C_Line > 1 Then
- UP;
- U_Char := Cur_Char;
- RIGHT;
- DOWN;
- Else
- U_Char := '|0';
- Right;
- End;
- R_Char := Cur_Char;
- DOWN;
- LEFT;
- D_Char := Cur_Char;
- If c_col > 1 Then
- LEFT;
- UP;
- L_Char := Cur_Char;
- RIGHT;
- Else
- L_Char := '|0';
- Up;
- End;
- Refresh := True;
-
- D_mode := XPos(D_Char,'│┤╡╛└┴├┼╞╘╪┘╧╢╣║╝╜╟╚╩╠╬╨╙╫',1);
- D_mode := (D_Mode > 0) + (D_Mode > 13);
- U_mode := XPos(U_Char,'│┤╡╕┐┬├┼╞╤╒╪┌╢╖╣║╗╟╔╦╠╬╥╓╫',1);
- U_mode := (U_Mode > 0) + (U_Mode > 13);
- L_mode := XPos(L_Char,'└┴┬├─┼╟╨╥╙╓╫┌╞╚╔╩╦╠═╬╧╤╘╒╪',1);
- L_mode := (L_Mode > 0) + (L_Mode > 13);
- R_mode := XPos(R_Char,'┤╢╖╜┐┴┬─┼╨╥╫┘╡╕╣╗╝╛╩╦═╬╧╤╪',1);
- R_mode := (R_Mode > 0) + (R_Mode > 13);
- RET;
-
- END_OF_MAC:
-
- INSERT_MODE := Temp_Insert; { Switch previous insert/overwrite mode }
- Tab_Expand := Temp_Tab_Expand;
- Pop_Labels;
- Undo_Stat := True;
-
- END_MACRO;
-
- $MACRO ASCII FROM ALL TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: ASCII
-
- Description: Displays an ASCII table of the extended IBM character set
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- DEF_INT( UL_COL, UL_ROW, LR_COL, LR_ROW, RX, CX, CP , CI);
- Def_Str(Temp_String);
-
- UL_COL := 3;
- UL_ROW := 4;
- LR_COL := 75;
- LR_ROW := 24;
-
- PUT_BOX(UL_COL,UL_ROW,LR_COL,LR_ROW,0,m_B_COLOR,'ASCII─TABLE',true);
- GOTOXY(1,SCREEN_LENGTH + 1 );
-
- Set_Global_Str('EVASCII1',
- '/T=Prev.Page/KC=<UP>/W=13/K1=0/K2=72/R=1/Y=' + str(lr_row - 2) +
- '/X=' + str( ul_col + 10 ));
- Set_Global_Str('EVASCII2',
- '/T=Next Page/KC=<DOWN>/W=15/K1=0/K2=80/R=2/Y=' + str(lr_row - 2) +
- '/X=' + str( ul_col + 28 ));
- Set_Global_Str('EVASCII3',
- '/T=Done/KC=<ESC>/W=9/K1=27/K2=1/R=3/Y=' + str(lr_row - 2) +
- '/X=' + str( ul_col + 47 ));
- Set_Global_Str('EVASCII4','/K1=0/K2=73/R=1/ND=1');
- Set_Global_Str('EVASCII5','/K1=0/K2=81/R=2/ND=1');
- Set_Global_Str('EVASCII6','/K1=13/K2=28/R=3/ND=1');
-
- CP := Global_Int('ASCII_PAGE');
- IF (CP = 3) THEN
- Goto START_PAGE3;
- END;
- IF (CP = 2) THEN
- Goto START_PAGE2;
- END;
-
- START_PAGE1:
-
- CP := 1;
- RX := UL_ROW + 1;
- CX := UL_COL + 1;
-
- Temp_String := '00 00 ^@ NUL │ 16 10 ^P DLE │ 32 20 │ 48 30 0 │ 64 40 @01 01 ^A SOH │ 17 11 ^Q DC1 │ 33 21 ! │ 49 31 1 │ 65 41 A02 02 ^B STX │ 18 12 ^R DC2 │ 34 22 " │ 50 32 2 │ 66 42 B';
- Call WRITE_TABLE;
- Temp_String := '03 03 ^C ETX │ 19 13 ^S DC3 │ 35 23 # │ 51 33 3 │ 67 43 C04 04 ^D EOT │ 20 14 ^T DC4 │ 36 24 $ │ 52 34 4 │ 68 44 D05 05 ^E ENQ │ 21 15 ^U NAK │ 37 25 % │ 53 35 5 │ 69 45 E';
- Call WRITE_TABLE;
- Temp_String := '06 06 ^F ACK │ 22 16 ^V SYN │ 38 26 & │ 54 36 6 │ 70 46 F07 07 ^G BEL │ 23 17 ^W ETB │ 39 27 '' │ 55 37 7 │ 71 47 G08 08 |8 ^H BS │ 24 18 ^X CAN │ 40 28 ( │ 56 38 8 │ 72 48 H';
- Call WRITE_TABLE;
- Temp_String := '09 09 |9 ^I HT │ 25 19 ^Y EM │ 41 29 ) │ 57 39 9 │ 73 49 I10 0A
- ^J LF │ 26 1A |26 ^Z SUB │ 42 2A * │ 58 3A : │ 74 4A J11 0B |11 ^K VT │ 27 1B ^[ ESC │ 43 2B + │ 59 3B ; │ 75 4B K';
- Call WRITE_TABLE;
- Temp_String := '12 0C |12 ^L FF │ 28 1C ^\ FS │ 44 2C , │ 60 3C < │ 76 4C L13 0D |13 ^M CR │ 29 1D ^] GS │ 45 2D - │ 61 3D = │ 77 4D M14 0E ^N SO │ 30 1E ^^ RS │ 46 2E . │ 62 3E > │ 78 4E N';
- Call WRITE_TABLE;
- Temp_String := '15 0F ^O SI │ 31 1F ^_ US │ 47 2F / │ 63 3F ? │ 79 4F O────────────────┴─────────────────┴───────────┴───────────┴──────────';
- Call WRITE_TABLE;
-
- RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
- KEY_LOOP1:
- READ_KEY;
- IF (KEY1 = 0) AND (KEY2 = 250) THEN
- RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
- IF return_int = 0 THEN
- Push_Key(Key1,Key2);
- Goto Do_End;
- END;
- ELSE
- RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
- END;
- IF Return_Int <> 0 THEN
- Return_Int := Parse_Int('/R=', return_str );
- IF Return_Int = 1 THEN
- Goto Start_Page3;
- ELSIF Return_Int = 2 THEN
- Goto Start_Page2;
- ELSIF Return_Int = 3 THEN
- Goto Do_End;
- END;
- END;
- Goto KEY_LOOP1;
-
- START_PAGE2:
- CP := 2;
-
- RX := UL_ROW + 1;
- CX := UL_COL + 1;
-
-
-
- Temp_String := '80 50 P │ 96 60 ` │ 112 70 p │ 128 80 Ç │ 144 90 É │ 160 A0 á 81 51 Q │ 97 61 a │ 113 71 q │ 129 81 ü │ 145 91 æ │ 161 A1 í 82 52 R │ 98 62 b │ 114 72 r │ 130 82 é │ 146 92 Æ │ 162 A2 ó ';
- Call WRITE_TABLE;
- Temp_String := '83 53 S │ 99 63 c │ 115 73 s │ 131 83 â │ 147 93 ô │ 163 A3 ú 84 54 T │ 100 64 d │ 116 74 t │ 132 84 ä │ 148 94 ö │ 164 A4 ñ 85 55 U │ 101 65 e │ 117 75 u │ 133 85 à │ 149 95 ò │ 165 A5 Ñ ';
- Call WRITE_TABLE;
- Temp_String := '86 56 V │ 102 66 f │ 118 76 v │ 134 86 å │ 150 96 û │ 166 A6 ª 87 57 W │ 103 67 g │ 119 77 w │ 135 87 ç │ 151 97 ù │ 167 A7 º 88 58 X │ 104 68 h │ 120 78 x │ 136 88 ê │ 152 98 ÿ │ 168 A8 ¿ ';
- Call WRITE_TABLE;
- Temp_String := '89 59 Y │ 105 69 i │ 121 79 y │ 137 89 ë │ 153 99 Ö │ 169 A9 ⌐ 90 5A Z │ 106 6A j │ 122 7A z │ 138 8A è │ 154 9A Ü │ 170 AA ¬ 91 5B [ │ 107 6B k │ 123 7B { │ 139 8B ï │ 155 9B ¢ │ 171 AB ½ ';
- Call WRITE_TABLE;
- Temp_String := '92 5C \ │ 108 6C l │ 124 7C || │ 140 8C î │ 156 9C £ │ 172 AC ¼ 93 5D ] │ 109 6D m │ 125 7D } │ 141 8D ì │ 157 9D ¥ │ 173 AD ¡ 94 5E ^ │ 110 6E n │ 126 7E ~ │ 142 8E Ä │ 158 9E ₧ │ 174 AE « ';
- Call WRITE_TABLE;
- Temp_String := '95 5F _ │ 111 6F o │ 127 7F │ 143 8F Å │ 159 9F ƒ │ 175 AF » ─────────┴───────────┴───────────┴───────────┴───────────┴────────── ';
- Call WRITE_TABLE;
-
- RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
- KEY_LOOP2:
- READ_KEY;
- IF (KEY1 = 0) AND (KEY2 = 250) THEN
- RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
- IF return_int = 0 THEN
- Push_Key(Key1,Key2);
- Goto Do_End;
- END;
- ELSE
- RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
- END;
- IF Return_Int <> 0 THEN
- Return_Int := Parse_Int('/R=', return_str );
- IF Return_Int = 1 THEN
- Goto Start_Page1;
- ELSIF Return_Int = 2 THEN
- Goto Start_Page3;
- ELSIF Return_Int = 3 THEN
- Goto Do_End;
- END;
- END;
- Goto KEY_LOOP2;
-
- START_PAGE3:
- CP := 3;
-
- RX := UL_ROW + 1;
- CX := UL_COL + 1;
-
- Temp_String := '176 B0 ░ │ 192 C0 └ │ 208 D0 ╨ │ 224 E0 α │ 240 F0 ≡ │ 177 B1 ▒ │ 193 C1 ┴ │ 209 D1 ╤ │ 225 E1 ß │ 241 F1 ± │ 178 B2 ▓ │ 194 C2 ┬ │ 210 D2 ╥ │ 226 E2 Γ │ 242 F2 ≥ │ ';
- Call WRITE_TABLE;
- Temp_String := '179 B3 │ │ 195 C3 ├ │ 211 D3 ╙ │ 227 E3 π │ 243 F3 ≤ │ 180 B4 ┤ │ 196 C4 ─ │ 212 D4 ╘ │ 228 E4 Σ │ 244 F4 ⌠ │ 181 B5 ╡ │ 197 C5 ┼ │ 213 D5 ╒ │ 229 E5 σ │ 245 F5 ⌡ │ ';
- Call WRITE_TABLE;
- Temp_String := '182 B6 ╢ │ 198 C6 ╞ │ 214 D6 ╓ │ 230 E6 µ │ 246 F6 ÷ │ 183 B7 ╖ │ 199 C7 ╟ │ 215 D7 ╫ │ 231 E7 τ │ 247 F7 ≈ │ 184 B8 ╕ │ 200 C8 ╚ │ 216 D8 ╪ │ 232 E8 Φ │ 248 F8 ° │ ';
- Call WRITE_TABLE;
- Temp_String := '185 B9 ╣ │ 201 C9 ╔ │ 217 D9 ┘ │ 233 E9 Θ │ 249 F9 ∙ │ 186 BA ║ │ 202 CA ╩ │ 218 DA ┌ │ 234 EA Ω │ 250 FA · │ 187 BB ╗ │ 203 CB ╦ │ 219 DB █ │ 235 EB δ │ 251 FB √ │ ';
- Call WRITE_TABLE;
- Temp_String := '188 BC ╝ │ 204 CC ╠ │ 220 DC ▄ │ 236 EC ∞ │ 252 FC ⁿ │ 189 BD ╜ │ 205 CD ═ │ 221 DD ▌ │ 237 ED φ │ 253 FD ² │ 190 BE ╛ │ 206 CE ╬ │ 222 DE ▐ │ 238 EE ε │ 254 FE ■ │ ';
- Call WRITE_TABLE;
- Temp_String := '191 BF ┐ │ 207 CF ╧ │ 223 DF ▀ │ 239 EF ∩ │ 255 FF │ ──────────┴───────────┴───────────┴───────────┴───────────┴──────────';
- Call WRITE_TABLE;
-
- RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
- KEY_LOOP3:
- READ_KEY;
- IF (KEY1 = 0) AND (KEY2 = 250) THEN
- RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
- IF return_int = 0 THEN
- Push_Key(Key1,Key2);
- Goto Do_End;
- END;
- ELSE
- RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
- END;
- IF Return_Int <> 0 THEN
- Return_Int := Parse_Int('/R=', return_str );
- IF Return_Int = 1 THEN
- Goto Start_Page2;
- ELSIF Return_Int = 2 THEN
- Goto Start_Page1;
- ELSIF Return_Int = 3 THEN
- Goto Do_End;
- END;
- END;
- Goto KEY_LOOP3;
-
- WRITE_TABLE:
- CI := 0;
- While (CI < 3) Do
- WRITE(Copy(Temp_String,(CI * 69) + 1,69),CX,RX,0,M_T_COLOR);
- ++ RX;
- ++ CI;
- End;
- RET;
-
- DO_END:
- RM('USERIN^CheckEvents /M=3/G=EVASCII/#=6');
- Set_Global_Int('ASCII_PAGE',CP);
- KILL_BOX;
- END_MACRO;
-
- $MACRO CONDENSE FROM EDIT TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- NAME: CONDENSE
-
- DESCRIPTION: Displays the current file so that only the lines that start on
- or before a set cutoff point or according to a search expression
- are shown. allows the user to move quickly through the file.
-
- Global Variables:
- Global_Int('Condense_Mode')
- 0 = Use cutoff column
- 1 = Use search expression
-
- Global_Str('Condense_Search')
- Contains the last used search expression
-
- Global_Str('Condense_Switches')
- Contains the list used search switches
-
- Global_Int('Cutoff_Col')
- Contains the last used cutoff column
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(Cutoff_Col,Up_Count,Temp_Line_Num,New_Line_Num,At_Top,At_Bottom,
- Temp_Integer,Good_Input,Line_Amount,Text_Window,Line_Window,Repaint,
- Left_Side,Width,Top,Write_Line,X2,Y2,Start_Line,Cursor_Line,Counter,
- Normal,Temp_Tab_Expand,Using_Search,Temp_Reg_Exp_Stat,
- Temp_Insert_Mode,Temp_Ignore_Case, twin,Scroll_Pos,T_Mou_X,T_Mou_Y);
- Def_Str(Blank_Line,Temp_String,Search_String,Search_Switches[8],Temp_Search);
-
- {Variables for special elapsed time code
- Def_Int(Start_Minutes,Start_Seconds,End_Minutes,End_Seconds);
- }
-
- Temp_Reg_Exp_Stat := Reg_Exp_Stat;
- Temp_Ignore_Case := Ignore_Case;
- Temp_Tab_Expand := Tab_Expand;
- Temp_Insert_Mode := Insert_Mode;
- Tab_Expand := False;
- Undo_Stat := False;
- Insert_Mode := True;
- Using_Search := Global_Int('Condense_Mode');
- Search_String := Global_Str('Condense_Search');
- IF (Search_String = '') THEN
- Search_String := Global_Str('Search_Str');
- END;
- IF (Search_String = '') THEN
- Using_Search := False;
- END;
- Temp_Search := Search_String;
-
- Search_Switches := Global_Str('Condense_Switches');
- IF (Search_Switches = '') THEN
- IF (XPos('I',Caps(Global_Str('Switches')),1)) THEN
- Search_Switches := 'I';
- END;
- IF (XPos('X',Caps(Global_Str('Switches')),1)) THEN
- Search_Switches := Search_Switches + 'X';
- END;
- END;
- Ignore_Case := (XPos('I',Search_Switches,1) > 0);
- Reg_Exp_Stat := (XPos('X',Search_Switches,1) = 0);
- If (Global_Int('Cutoff_Col') < 1) Then
- Set_Global_Int('Cutoff_Col',1);
- End;
- If (Global_Int('Cutoff_Col') > 18) Then
- Set_Global_Int('Cutoff_Col',18);
- End;
- Cutoff_Col := Global_Int('Cutoff_Col');
- IF ((Not(Using_Search)) and (Cutoff_Col = 1)) THEN
- Reg_Exp_Stat := True;
- Search_String := '%[~ |9|0]';
- END;
- Push_Labels;
- FLABEL('Help',1,$FF);
- Flabel('Column',2,$FF);
- Flabel('Search',3,$FF);
- Messages := False;
- Left_Side := Win_X1 + 2;
- Cursor_Line := Win_Y1 + 1;
- Width := (Win_X2 - Win_X1) - 1;
- Top := Win_Y1 + 1;
- Line_Amount := (Win_Y2 - Win_Y1) - 1;
- X2 := Win_X2;
- Y2 := Win_Y2;
- Blank_Line := Copy(' ',1,Width);
- Text_Window := Cur_Window;
- Temp_Line_Num := C_Line;
- Refresh := False;
- Normal := True;
-
- Create_Window;
- {make window the same as the text window}
- Window_Attr := $80;
- Size_Window(Left_Side - 2,Top - 1,X2,Y2);
- Line_Window := Cur_Window;
- Switch_Window(Text_Window);
- Repaint := False;
- At_Top := False;
- At_Bottom := False;
- Write(Copy('════════════════════════════════════════',1,Width / 2),Win_X1 + 1,Win_Y1,0,B_Color);
- Write('CONDENSED',(Width / 2) - 5,Win_Y1,0,B_Color);
- Make_Message('');
- Start_Line := Temp_Line_Num;
- Up_Count := Line_Amount / 2;
- Call GET_LINES;
- Call GET_LINE_NUM;
- If (Check_Key) Then
- End;
-
- MAIN_LOOP:
- {
- Make_Message('AT_TOP=' + Str(AT_TOP) + ' AT_BOTTOM=' + STR(AT_BOTTOM) +
- ' LINE_AMOUT=' + Str(LINE_AMOUNT) + ' C_LINE=' + Str(C_Line));
- }
- Read_Key;
- Insert_Mode := True;
- IF ((Key1 = 27) or (Key1 = 13)) THEN
- Goto LOOP_EXIT;
- END;
- IF (Key1 = 0) THEN
- IF ((Key2 = 244) or (Key2 = 245)) THEN
- Goto LOOP_EXIT;
- END;
- Call GET_KEY;
- END;
- Goto MAIN_LOOP;
-
- LOOP_EXIT:
- Switch_Window(Line_Window);
- Temp_Integer := Val(New_Line_Num,Get_Line);
- If ((Key1 = 27) or (New_Line_Num = 0) or (Key2 = 245)) Then
- New_Line_Num := Temp_Line_Num;
- End;
-
- Delete_Window;
-
- Switch_Window(Text_Window);
-
- {These 6 lines will center the selected line on the screen if possible}
-
- Refresh := True;
-
- WHILE (C_Row > ((Win_Y2 - Win_Y1) / 2)) DO
- Up;
- END;
- WHILE (C_Row < ((Win_Y2 - Win_Y1) / 2)) DO
- Down;
- END;
- Goto_Line(New_Line_Num);
- goto_col(Cutoff_Col);
- Goto END_OF_MAC;
-
- GET_LINES:
- Switch_Window(Line_Window);
- {special development code for calculating elapsed time
- If ((Val(Start_Minutes,Copy(Time,4,2))) and (Val(Start_Seconds,Copy(Time,7,2)))) Then
- End;
- }
-
- {Determine the line to start looking at}
- If ((Up_Count > 0) or (Repaint = True)) Then
- Tof;
- Else
- Goto_Line(Line_Amount);
- End;
-
- If (Get_Line <> '') Then
- Temp_Integer := Val(Start_Line,Get_Line);
- Else
- Start_Line := Temp_Line_Num;
- End;
- GET_LINES2:
- {Clear displayed lines}
- Temp_Integer := Top + Line_Amount;
- Counter := Top;
- While (Counter < Temp_Integer) Do
- Write(Blank_Line,Left_Side - 1,Counter,0,Text_Color);
- ++Counter;
- End;
-
- Tof;
- {Delete all lines in line number file}
- While Not(At_Eof) Do
- Del_Line;
- End;
- {Find top line}
- Switch_Window(Text_Window);
- If (Normal = True) Then
- Goto_Line(Start_Line);
- End;
-
- At_Top := False;
-
- If (Up_Count = 0) Then
- Goto PAGING_DOWN;
- End;
-
- If (Repaint) Then
- Repaint := False;
- Switch_Window(Text_Window);
- Goto PAGING_DOWN;
- End;
-
- Counter := Up_Count;
- SEEK_UP:
- If ((Using_Search) or (Cutoff_Col = 1)) Then
- If (Search_Bwd(Search_String,0)) Then
- Temp_String := Str(C_Line);
- Switch_Window(Line_Window);
- Cr;
- Up;
- Put_Line(Temp_String);
- Switch_Window(Text_Window);
- --Counter;
- If (C_Line = 1) Then
- Goto TOP_FOUND;
- End;
- Up;
- goto_col(1);
- IF (Counter > 0) THEN
- Goto SEEK_UP;
- END;
- ELSE
- IF (Error_Level) THEN
- RM('MEERROR');
- Ret;
- END;
- At_Top := True;
- End;
- ELSE
- First_Word;
- If ((c_col <= Cutoff_Col) and (Not(At_Eol))) Then
- Temp_String := Str(C_Line);
- Switch_Window(Line_Window);
- Cr;
- Up;
- Put_Line(Temp_String);
- Switch_Window(Text_Window);
- --Counter;
- End;
- If (C_Line = 1) Then
- Goto TOP_FOUND;
- End;
- Up;
- IF (Counter > 0) THEN
- Goto SEEK_UP;
- END;
- END;
-
- TOP_FOUND:
- At_Top := (C_Line = 1) or (At_Top);
- Down;
- Switch_Window(Line_Window);
- Tof;
-
- While (Up_Count > Counter) Do
- Switch_Window(Line_Window);
- Good_Input := Val(Temp_Integer,Get_Line);
- Write_Line := (C_Line + Top) - 1;
- Down;
- Switch_Window(Text_Window);
- Goto_Line(Temp_Integer);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,Write_Line,0,Text_Color);
- --Up_Count;
- End;
-
- Switch_Window(Text_Window);
- Down;
- PAGING_DOWN:
- At_Top := (C_Line = 1) or (At_Top);
-
- At_Bottom := False;
- Switch_Window(Line_Window);
- Write_Line := (C_Line + Top) - 2;
- Counter := C_Line;
- Switch_Window(Text_Window);
- If (Counter > Line_Amount) Then
- Goto NO_MORE_LINES;
- END;
-
- SEEK_DOWN:
- If ((Using_Search) or (Cutoff_Col = 1)) Then
- If (Search_Fwd(Search_String,0)) Then
- Temp_Integer := C_Line;
- Switch_Window(Line_Window);
- Put_Line(Str(Temp_Integer));
- Down;
- Switch_Window(Text_Window);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,(Counter + Top) - 1,0,Text_Color);
- Down;
- goto_col(1);
- ++Counter;
- If (At_Eof) Then
- Goto NO_MORE_LINES;
- End;
- IF (Counter <= Line_Amount) THEN
- Goto SEEK_DOWN;
- END;
- ELSE
- IF (Error_Level) THEN
- RM('MEERROR');
- Ret;
- END;
- At_Bottom := True;
- End;
- ELSE
- First_Word;
- While ((c_col > Cutoff_Col) or (At_Eol)) Do
- Down;
- First_Word;
- If (At_Eof) Then
- Goto NO_MORE_LINES;
- End;
- End;
-
- Temp_Integer := C_Line;
- Switch_Window(Line_Window);
- Put_Line(Str(Temp_Integer));
- Down;
- Switch_Window(Text_Window);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,(Counter + Top) - 1,0,Text_Color);
- Down;
- ++Counter;
- IF (Counter <= Line_Amount) THEN
- Goto SEEK_DOWN;
- END;
- END;
-
- NO_MORE_LINES:
- At_Bottom := (At_Eof) or (At_Bottom);
- Switch_Window(Line_Window);
- Tof;
- If (Search_FWD(Str(Start_Line),0)) Then
- End;
- goto_col(1);
-
- Cursor_Line := C_Line + Win_Y1;
- GotoXY(Left_Side - 1,Cursor_Line);
- {special development code to determine elapsed time
- If ((Val(End_Minutes,Copy(Time,4,2))) and (Val(End_Seconds,Copy(Time,7,2)))) Then
- End;
- If (Start_Seconds > End_Seconds) Then
- End_Seconds := End_Seconds + 60;
- --End_Minutes;
- End;
- If (Start_Minutes > End_Minutes) Then
- End_Minutes := End_Minutes + 60;
- End;
- Make_Message('Old Elapsed time ' + Str(End_Minutes - Start_Minutes) + ':' + Str(End_Seconds - Start_Seconds));
- Read_Key;
- }
- RET;
-
- GET_KEY:
- IF (Key2 = 251) THEN
- IF (Mou_Last_X = Win_X2) AND (Mou_Last_y > (win_y1 + 1)) AND
- (Mou_Last_y < (win_y2 - 1)) THEN
- Switch_Window(Text_Window);
- RM('MOUSE^GotoScrollBar');
- Start_Line := C_Line;
- Switch_Window(Line_Window);
- Erase_Window;
- Up_Count := Line_Amount / 2;
- Call GET_LINES2;
- Call GET_LINE_NUM;
- Ret;
- END;
- END;
- IF (Key2 = 250) THEN
- T_Mou_X := Mou_Last_X;
- T_Mou_Y := Mou_Last_Y;
- IF (Mou_Last_X = Win_X2) THEN
- IF (mou_last_y = (win_y2 - 1)) THEN
- Goto SCROLL_UP;
- ELSIF (mou_last_y = (win_y1 + 1)) THEN
- Goto SCROLL_DOWN;
- ELSIF (Mou_Last_y > win_y1) AND (Mou_Last_y < win_y2) THEN
- Temp_Integer := Mou_Last_Y - Win_Y1 - 1;
- Switch_Window(Text_WIndow);
- Scroll_Pos := Cur_Scroll_Pos;
- Switch_Window(Line_WIndow);
- IF (Temp_Integer > scroll_pos) THEN
- Goto page_down;
- ELSIF (Temp_Integer < scroll_pos) THEN
- Goto page_up;
- END;
- END;
- ELSIF (Mou_Last_Y = Fkey_ROW) THEN
- RM('MOUSE^MOUSEFKEY');
- Ret;
- ELSIF ((Mou_Last_Y > Win_Y1) and (Mou_Last_Y < Win_Y2) and
- (Mou_Last_X > Win_X1) and (Mou_Last_X < Win_X2)) THEN
- {Check to see if mouse was clicked inside the window}
- Counter := C_Line;
- Goto_Line(Mou_Last_Y - Win_Y1);
- IF (At_Eof) THEN
- Goto_Line(Counter);
- END;
- Cursor_Line := C_Line + Win_Y1;
- GotoXY(Left_Side - 1,Cursor_Line);
- ELSE
- RM('USERIN^CHECKEVENTS /M=1/G=CONDENSEEV/#=3');
- IF (Return_Int) THEN
- Push_Key(Parse_Int('/K1=',Global_Str('CONDENSEEV' + Str(Return_Int))),
- Parse_Int('/K2=',Global_Str('CONDENSEEV' + Str(Return_Int))));
- Ret;
- END;
- END;
- END;
- If ((Key2 = 72) or (Key2 = 240)) Then {Up arrow}
- If (C_line > 1) Then
- Up;
- Eol;
- --Cursor_Line;
- GotoXY(Left_Side - 1,Cursor_Line);
- Else
- SCROLL_DOWN:
- If Not(At_Top) Then {Scroll down}
- Counter := C_Line;
- {Check for at bottom}
- Switch_Window(Line_Window);
- Goto_Line(Line_Amount);
- Goto_Col(1);
- At_Bottom := At_Eof;
- Del_Line;
- {Goto the top line}
- Tof;
- Temp_Integer := Val(Start_Line,Get_Line);
- {Look for the next line up in the text file}
- Switch_Window(Text_Window);
- Goto_Line(Start_Line);
- Up;
- Eol;
- If ((Using_Search) or (Cutoff_Col = 1)) Then
- If (Search_Bwd(Search_String,0)) Then
- Temp_Integer := C_Line;
- Scroll_Box_Dn(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,Top,0,Text_Color);
- At_Top := (C_Line = 1);
- Switch_Window(Line_Window);
- {Delete bottom line}
- Goto_Line(Line_Amount);
- Del_Line;
- {Goto the top line and insert new line above it}
- Tof;
- Cr;
- Up;
- Put_Line(Str(Temp_Integer));
- ELSE
- At_Top := True;
- End;
- ELSE
- First_Word;
- While ((c_col > Cutoff_Col) or (At_Eol)) Do
- Up;
- First_Word;
- If (C_Line = 1) Then
- At_Top := True;
- Goto No_Scroll_Down;
- End;
- End;
- At_Top := (C_Line = 1);
- Temp_Integer := C_Line;
- Scroll_Box_Dn(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,Top,0,Text_Color);
- Switch_Window(Line_Window);
- {Delete bottom line}
- Goto_Line(Line_Amount);
- Del_Line;
- {Goto the top line and insert new line above it}
- Tof;
- Cr;
- Up;
- Put_Line(Str(Temp_Integer));
- END;
- NO_SCROLL_DOWN:
- Switch_Window(Line_Window);
- IF (Key2 = 250) THEN
- Goto_Line(Counter);
- Mou_Repeat := True;
- CHECK_STAT2:
- Mou_Check_Status;
- IF ((Mou_Last_Status AND 1) = 0) OR (T_Mou_x <> Mou_Last_X) OR
- (T_Mou_y <> Mou_Last_Y) THEN
- GOTO MOU_SCROLL_DOWN_EXIT;
- END;
- IF check_key THEN
- IF (key1 <> 0) AND (key2 <> 250) THEN
- push_key(key1, key2);
- GOTO MOU_SCROLL_DOWN_EXIT;
- END;
- Call GET_LINE_NUM;
- goto scroll_DOWN;
- END;
- goto CHECK_STAT2;
- MOU_SCROLL_DOWN_EXIT:
- Mou_Repeat := False;
- END;
- End;
- End;
- End;
-
- If ((Key2 = 80) or (Key2 = 241)) Then {Down arrow}
- If ((C_line < Line_Amount) and (Not(At_Eof))) Then
- Down;
- Eol;
- ++Cursor_Line;
- GotoXY(Left_Side - 1,Cursor_Line);
- Else
- SCROLL_UP:
- If Not(At_Bottom) Then {Scroll up}
- Counter := C_Line;
- {Goto the bottom line}
- Goto_Line(Line_Amount);
- Temp_Integer := Val(Start_Line,Get_Line);
- Switch_Window(Text_Window);
- Goto_Line(Start_Line);
- Eol;
- If (At_Eof) Then
- At_Bottom := True;
- Goto NO_SCROLL_UP;
- End;
-
- {Delete top line in line window}
- At_Top := False;
- Switch_Window(Line_Window);
- Tof;
- Del_Line;
- Goto_Line(Line_Amount);
- Scroll_Box_UP(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
-
- {Look for the next line down in the text file}
- Switch_Window(Text_Window);
- If ((Using_Search) or (Cutoff_Col = 1)) Then
- If (Search_Fwd(Search_String,0)) Then
- Temp_Integer := C_Line;
- Switch_Window(Text_Window);
- Write(Copy(Get_Line,1,Width),Left_Side - 1,Top + Line_Amount - 1,0,Text_Color);
- Eol;
- At_Bottom := At_Eof;
- Switch_Window(Line_Window);
- Put_Line(Str(Temp_Integer));
- ELSE
- At_Bottom := True;
- End;
- ELSE
- Down;
- First_Word;
- While ((c_col > Cutoff_Col) or (At_Eol)) Do
- Down;
- First_Word;
- If (At_Eof) Then
- At_Bottom := True;
- Goto No_Scroll_Up;
- End;
- End;
- Temp_Integer := C_Line;
- Write(Copy(Get_Line,1,Width),Left_Side - 1,Top + Line_Amount - 1,0,Text_Color);
- At_Bottom := At_Eof;
- Switch_Window(Line_Window);
- Put_Line(Str(Temp_Integer));
- END;
- NO_SCROLL_UP:
- Switch_Window(Line_Window);
- IF (Key2 = 250) THEN
- Goto_Line(Counter);
- Mou_Repeat := True;
- CHECK_STAT1:
- Mou_Check_Status;
- IF ((Mou_Last_Status AND 1) = 0) OR (T_Mou_x <> Mou_Last_X) OR
- (T_Mou_y <> Mou_Last_Y) THEN
- GOTO MOU_SCROLL_UP_EXIT;
- END;
- IF check_key THEN
- IF (key1 <> 0) AND (key2 <> 250) THEN
- push_key(key1, key2);
- GOTO MOU_SCROLL_UP_EXIT;
- END;
- Call GET_LINE_NUM;
- goto scroll_up;
- END;
- goto CHECK_STAT1;
- MOU_SCROLL_UP_EXIT:
- Mou_Repeat := False;
- END;
- End;
- End;
- End;
- If (Key2 = 73) Then
- PAGE_UP:
- If (At_Top) Then {Page up}
- Tof;
- Cursor_Line := Win_Y1 + 1;
- GotoXY(Left_Side - 1,Cursor_Line);
- Else
- Up_Count := Line_Amount;
- Call GET_LINES;
- End;
- End;
- If (Key2 = 81) Then
- PAGE_DOWN:
- Goto_Col(1);
- If (At_Bottom) Then {Page down}
- WHILE Not(AT_EOF) DO
- Down;
- ++Cursor_Line;
- END;
- Up;
- --Cursor_Line;
- GotoXY(Left_Side - 1,Cursor_Line);
- Else
- Up_Count := 0;
- Call GET_LINES;
- End;
- End;
- If ((Key2 = 119) and (Not(At_Top))) Then {Top of file}
- Switch_Window(Text_Window);
- Tof;
- Up_Count := 0;
- Normal := False;
- Call GET_LINES;
- Normal := True;
- At_Top := True;
- End;
- If ((Key2 = 117) and (Not(At_Bottom))) Then {Bottom_Of_File}
- Switch_Window(Text_Window);
- Eof;
- goto_col(1);
- While (At_Eol) Do
- Up;
- End;
- Up_Count := Line_Amount;
- Normal := False;
- Call GET_LINES;
- Goto_Line(Line_Amount);
- Cursor_Line := C_Line + Win_Y1;
- GotoXY(Left_Side - 1,Cursor_Line);
- Normal := True;
- At_Bottom := True;
- End;
-
- If (Key2 = 59) Then {F1(Help)}
- HELP('CN');
- End;
- If (Key2 = 60) Then {F2(set cutoff column)}
- Make_Message('');
- Return_Int := Cutoff_Col;
- RM('userin^QUERYBOX /N=1/P=Display lines with text beginning at or before' +
- ' column:/MIN=1/MAX=254/H=CC/C=1/L=2/W=2/T=SET CUTOFF COLUMN');
- IF ((Return_Str = 'FALSE') and (Using_Search = True)) THEN
- {If they pressed <ESC> and we are not already using cutoff column, then go back
- to using search}
- Goto DO_SEARCH;
- END;
- Set_Global_Int('Cutoff_Col',Return_Int);
- Cutoff_Col := Return_Int;
- DO_CUTOFF:
- Repaint := True;
- At_Top := False;
- At_Bottom := False;
- IF (Cutoff_Col = 1) THEN
- Reg_Exp_Stat := True;
- Search_String := '%[~ |9|0]';
- END;
- Using_Search := False;
- Set_Global_Int('Condense_Mode',False);
- Call GET_LINES;
- Repaint := False;
- End;
-
- If (Key2 = 61) Then {F3(set search string)}
- Make_Message('');
- Search_String := Temp_Search;
- Set_Global_Str('CMISTR_1', Search_String );
- Set_Global_Str('CMIPARM_1', '/T=Search for:/C=1/L=1/W=64' );
- Set_Global_Str('CMIPARM_2','/T=>>>>/TP=6/C=1/L=2/W=6');
- Set_Global_Str('CMISTR_2' , 'ACCEPT');
-
- Set_Global_Str('CMISTR_3' ,'/T=X');
- Set_Global_Int('CMIINT_3' , Xpos('I',Search_Switches,1) = 0);
- Set_Global_Str('CMIPARM_3','/TP=5/T=Case sensitive: /C=1/W=1/L=3');
-
- Set_Global_Str('CMISTR_4' ,'/T=X');
- Set_Global_Int('CMIINT_4' , Xpos('X',Search_Switches,1) = 0);
- Set_Global_Str('CMIPARM_4','/TP=5/T=Regular expressions:/C=1/W=1/L=4');
- {
- Set_Global_Str('CMISTR_3', Search_Switches );
- Set_Global_Str('CMIPARM_3', '/T=Switches [I,X]:/C=1/L=3/W=2' );
- }
- RM( 'USERIN^Data_In /PRE=CM/H=CC/#=4/A=3/S=1/X=1/Y=3/T=DISPLAY LINES CONTAINING SEARCH STRING' );
- IF ((Return_Int = 0) and (Using_Search = False)) THEN
- {If they pressed <ESC> and we are not already using search, then go back to
- using cutoff column}
- Goto DO_CUTOFF;
- END;
- Search_String := Global_Str('CMISTR_1');
- Search_Switches := '';
- IF (Global_Int('CMIINT_3') = 0) THEN
- Search_Switches := Search_Switches + 'I';
- END;
- IF (Global_Int('CMIINT_4') = 0) THEN
- Search_Switches := Search_Switches + 'X';
- END;
- {
- Search_Switches := Caps(Global_Str('CMISTR_3'));
- }
- Ignore_Case := (XPos('I',Search_Switches,1) > 0);
- Reg_Exp_Stat := (XPos('X',Search_Switches,1) = 0);
- Temp_Search := Search_String;
- DO_SEARCH:
- Repaint := True;
- At_Top := False;
- At_Bottom := False;
- Using_Search := True;
- Set_Global_Int('Condense_Mode',True);
- Set_Global_Str('Condense_Search',Search_String);
- Set_Global_Str('Condense_Switches',Search_Switches);
- Kill_Box;
- Call GET_LINES;
- Repaint := False;
- End;
- Call GET_LINE_NUM;
- RET;
-
- GET_LINE_NUM:
- IF (Val(New_Line_Num,Get_Line)) THEN
- New_Line_Num := 0;
- END;
- Put_Line_Num(New_Line_Num);
-
- Set_Global_Str('CONDENSEEV1','/T=Select line/KC=<ENTER>/W=18/K1=13/K2=28/R=13/Y=' +
- Str(Message_Row) + '/X=1');
- Set_Global_Str('CONDENSEEV2','/T=Cancel/KC=<ESC>/W=11/K1=27/K2=1/R=13/Y=' +
- Str(Message_Row) + '/X=20');
- IF (Using_Search) THEN
- Set_Global_Str('CONDENSEEV3','/T=Displaying by search string./KC=/W=28/K1=0/K2=61/R=61/Y=' +
- Str(Message_Row) + '/X=32');
- ELSE
- Set_Global_Str('CONDENSEEV3','/T=Displaying by cutoff column./KC=/W=28/K1=0/K2=60/R=60/Y=' +
- Str(Message_Row) + '/X=32');
- END;
-
- RM('USERIN^CHECKEVENTS /M=2/G=CONDENSEEV/#=3');
- switch_window( text_window );
- WHILE c_row > 1 DO
- up;
- END;
- goto_line( new_line_num );
- update_scroll_bar;
- switch_window( line_window );
- RET;
-
- PROCESS_MOUSE:
- RET;
-
- END_OF_MAC:
- Tab_Expand := Temp_Tab_Expand;
- Reg_Exp_Stat := Temp_Reg_Exp_Stat;
-
- Insert_Mode := Temp_Insert_Mode;
- Ignore_Case := Temp_Ignore_Case;
- Undo_Stat := True;
- Kill_Box;
- Refresh := True;
- Make_Message('');
- Pop_Labels;
- Messages := True;
- Redraw;
-
- END_MACRO;
-
- $MACRO SQUEEZE TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: SQUEEZE
-
- Description: Converts all leading space characters to the appropriate # of
- tab characters.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- def_int( jx );
- def_str( tstr );
-
- tof;
- refresh := false;
- undo_stat := false; {no undo, to improve speed}
- while NOT( At_EOF ) Do
- first_word;
- jx := c_col;
- tstr := Get_Word('');
- Put_Line('');
- goto_col( jx );
- Text( tstr );
- down;
- Put_Line_Num( c_line );
- end;
- refresh := true;
- tof;
- undo_stat := true;
- END_MACRO;