home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-6.ZIP / SRC / SUPPORT.SRC < prev    next >
Encoding:
Text File  |  1990-06-04  |  41.0 KB  |  1,479 lines

  1. $MACRO_FILE SUPPORT;
  2. {******************************************************************************
  3.                                                             MACRO FILE SUPPORT
  4.  
  5. LINEDRAW - Line and box drawing
  6. ASCII - ASCII table
  7. CONDENSE - Condensed display
  8. SQUEEZE - Convert tabs to spaces, or vice versa
  9.  
  10.                                 Copyright 1989 by American Cybernetics, Inc.
  11. ******************************************************************************}
  12.  
  13.  
  14. $MACRO LINEDRAW TRANS;
  15. {******************************************************************************
  16.                                                                 MULTI-EDIT MACRO
  17.  
  18. Name: LINEDRAW
  19.  
  20. Description: This macro allows the user to draw the single and double line
  21. characters using the arrow keys to create lines and boxes etc.
  22.  
  23.                             (C) Copyright 1989 by American Cybernetics, Inc.
  24. ******************************************************************************}
  25.  
  26. {
  27. Here is a list of all of the linedrawing characters:
  28. │┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌
  29. }
  30. { Define variables }
  31.  
  32.     Def_Char(U_Char,D_Char,L_Char,R_Char);
  33.     Def_Int(Temp_Integer,Present_Direction,A_Left,A_Right,A_Up,A_Down,Shift_Stat,
  34.                     Draw_Mode,Temp_Insert,D_Mode,U_Mode,L_Mode,R_Mode,Temp_Tab_Expand,K1,
  35.                     K2);
  36.  
  37. { Store current status of certain stuff so we can restore it upon exit. }
  38.     Temp_Insert := INSERT_MODE;
  39.     Insert_Mode := False;
  40.     Temp_Tab_Expand := Tab_Expand;
  41.     Tab_Expand := False;
  42.     Undo_Stat := False;
  43.     Push_Labels;
  44.     refresh := TRUE;
  45.     Redraw;
  46. { Initialize variables }
  47.  
  48.     Present_Direction := 0;
  49.     A_Left := 1;
  50.     A_Right := 2;
  51.     A_Up := 3;
  52.     A_Down := 4;
  53.  
  54.     Draw_Mode := 1;
  55.     MAKE_MESSAGE('SINGLE LINE: |26 = move, Shift |26 = draw, F2 = ╬, Esc = quit.');
  56.     FLABEL('Double',2,$FF);
  57.     Goto WAIT_FOR_KEYPRESS;
  58.  
  59. GO_LEFT:
  60.     Left;
  61.  
  62. WAIT_FOR_KEYPRESS:
  63.     READ_KEY;
  64.  
  65. GET_KEY_CODES:
  66.     K1 := Key1;
  67.     K2 := Key2;
  68. loopxxx:
  69. {This is to take care of key type ahead filling up the buffer}
  70.     IF (Check_Key) THEN
  71.         IF (key1 = k1) AND (key2 = k2) THEN
  72.             goto loopxxx;
  73.         ELSE
  74.             push_key(key1,key2);
  75.         END;
  76.     END;
  77. {This Shift_Stat stuff is kind of a kludge to work with extended keyboard.  It
  78. is possible that this will not work properly 100% of the time}
  79.     R_AX := $0200;
  80.     INTR($16);
  81.     Shift_Stat := ((R_AX and $0003) > 0);
  82.     Insert_Mode := False;
  83.  
  84.     If (K1 = 27) Then
  85.         Make_Message('');
  86.         Goto END_OF_MAC; { If so, then user pressed <ESC> so...}
  87.     End;
  88.     IF K2 = 59 THEN
  89.         Help('LD');
  90.     END;
  91.     IF K2 = 60 THEN
  92.         IF (Draw_Mode < 3) THEN
  93.             ++Draw_Mode;
  94.         Else
  95.             Draw_Mode := 1;
  96.         END;
  97.  
  98.         MAKE_MESSAGE(Copy(
  99. '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.         '
  100.                                                                                 ,((Draw_Mode - 1) * 68) + 1,68));
  101.         FLABEL(Copy('DoubleErase Single',((Draw_Mode - 1) * 6) + 1,6),2,$FF);
  102.         Goto WAIT_FOR_KEYPRESS;
  103.     END;
  104.  
  105.     IF (K2 = 73) THEN
  106.         Page_Up;
  107.     End;
  108.  
  109.     IF (K2 = 81) THEN
  110.         Page_Down;
  111.     End;
  112.  
  113.     IF (K2 = 71) THEN
  114.         Home;
  115.     End;
  116.  
  117.     IF (K2 = 79) THEN
  118.         Eol;
  119.     End;
  120.  
  121. {We translate mouse cursor key codes up here to simplify things down there}
  122.     IF (K2 > 239) THEN
  123.         IF (K2 = 240) THEN
  124.             K2 := 72;
  125.         END;
  126.         IF (K2 = 241) THEN
  127.             K2 := 80;
  128.         END;
  129.         IF (K2 = 242) THEN
  130.             K2 := 75;
  131.         END;
  132.         IF (K2 = 243) THEN
  133.             K2 := 77;
  134.         END;
  135.     END;
  136.  
  137.     IF (K2 = 77) Then                                             {Right arrow}
  138.         If c_col > 252 Then {Don't allow cursor to wrap down}
  139.             Goto WAIT_FOR_KEYPRESS;
  140.         End;
  141.         If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move right}
  142.             Right;
  143.             Present_Direction := 0;
  144.             Goto WAIT_FOR_KEYPRESS;
  145.         END;
  146.         If ((K1 = 54) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
  147.             IF (Draw_Mode = 3) THEN
  148.                 Text(' ');
  149.                 Present_Direction := 0;
  150.                 Goto WAIT_FOR_KEYPRESS;
  151.             END;
  152.             If Present_Direction = A_Right Then {If we were previously going a
  153. different direction, then insert char at current cusror position. Otherwise,
  154. insert char in the next right position}
  155.                 Right;
  156.             End;
  157.             Present_Direction := A_Right;
  158.             Call LOOK_AROUND;
  159.  
  160.             Temp_Integer := XPos(L_Char,'┐╖╕╗┘╛╜╝┤╢╣╡',1);
  161.             If (Temp_Integer) Then
  162.                 Left;
  163.                 Text(Copy('┬╥┬╥┴┴╨╨┼╫╫┼╦╦╤╦╩╧╩╩╬╬╬╪',((Draw_Mode - 1) * 12) + Temp_Integer,1));
  164.                 Goto GO_LEFT;
  165.             End;
  166.  
  167.             If ((L_Mode > 0) and ((D_Mode + U_Mode + R_Mode) = 0)) Then
  168.                 Text(Copy('─═',Draw_Mode,1));
  169.                 Goto GO_LEFT;
  170.             End;
  171.  
  172.             If ((D_Mode = 1) And (U_Mode = 1)) Then
  173.                 Text(Copy('├╞├╞╞╠├╞┤╣┼╬┤╣├╞╡╡╡╡╪╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  174.                 Goto GO_LEFT;
  175.             End;
  176.  
  177.             If ((D_Mode = 2) And (U_Mode = 2)) Then
  178.                 Text(Copy('╟╠╟╠╟╠╟╠╢╣╫╬╢╠╟╠┤╣┤╣┼╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  179.                 Goto GO_LEFT;
  180.             End;
  181.  
  182.             If (D_Mode = 1) Then
  183.                 Text(Copy('┌╒┌╒┐╕┌╒┐╗┬╦┐╗┌╒┐╕┌╕┬╤',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  184.                 Goto GO_LEFT;
  185.             End;
  186.  
  187.             If (D_Mode = 2) Then
  188.                 Text(Copy('╓╔╓╔╓╔╓╔╖╗╥╦╖╗╓╔╖╗╓╗╥╦',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  189.                 Goto GO_LEFT;
  190.             End;
  191.  
  192.             If (U_Mode = 2) Then
  193.                 Text(Copy('╙╚╙╚╙╚╙╚╜╝╨╩╜╝╙╚╜╝╙╝╨╩',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  194.                 Goto GO_LEFT;
  195.             End;
  196.  
  197.             If (U_Mode = 1) Then
  198.                 Text(Copy('└╘└╘┘╛└╘┘╝┴╩┘╝└╘┘╛└╛┴╧',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  199.                 Goto GO_LEFT;
  200.             End;
  201.  
  202. {If no other condition exists...}
  203.             Text(Copy('─═',Draw_Mode,1));
  204.             Goto GO_LEFT;
  205.         END;
  206.     END;
  207.  
  208.     IF (K2 = 75) Then                                              {Left arrow}
  209.         If c_col = 1 Then {Don't allow cursor to wrap up}
  210.             Goto WAIT_FOR_KEYPRESS;
  211.         End;
  212.         If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move left}
  213.             Left;
  214.             Present_Direction := 0;
  215.             Goto WAIT_FOR_KEYPRESS;
  216.         END;
  217.         If ((K1 = 52) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
  218.             IF (Draw_Mode = 3) THEN
  219.                 Text(' ');
  220.                 Left;
  221.                 Left;
  222.                 Present_Direction := 0;
  223.                 Goto WAIT_FOR_KEYPRESS;
  224.             END;
  225.             If Present_Direction = A_Left Then {If we were previously going a
  226. different direction, then insert char at current cusror position. Otherwise,
  227. insert char in the next left position}
  228.                 Left;
  229.             End;
  230.             Present_Direction := A_Left;
  231.             Call LOOK_AROUND;
  232.  
  233.             Temp_Integer := XPos(R_Char,'┌╓╒╔└╘╙╚├╟╠╞',1);
  234.             If (Temp_Integer) Then
  235.                 Right;
  236.                 Text(Copy('┬╥┬╥┴┴╨╨┼╫╫┼╦╦╤╦╩╧╩╩╬╬╬╪',((Draw_Mode - 1) * 12) + Temp_Integer,1));
  237.                 Goto GO_LEFT;
  238.             End;
  239.  
  240.             If ((R_Mode > 0) and ((D_Mode + U_Mode + L_Mode) = 0)) Then
  241.                 Text(Copy('─═',Draw_Mode,1));
  242.                 Goto GO_LEFT;
  243.             End;
  244.  
  245.             If ((D_Mode = 1) And (U_Mode = 1)) Then
  246.                 Text(Copy('┤╡├╠╞╞┤╡┤╡┼╬┤╞┤╡╡╣├╠╪╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  247.                 Goto GO_LEFT;
  248.             End;
  249.  
  250.  
  251.             If ((D_Mode = 2) And (U_Mode = 2)) Then
  252.                 Text(Copy('╢╣╟╠├╠╢╣╢╣╫╬├╠╢╣╢╣╟╣┼╬',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  253.                 Goto GO_LEFT;
  254.             End;
  255.  
  256.             If (D_Mode = 1) Then
  257.                 Text(Copy('┐╕┌╔┌╒┐╕┐╕┬╦┐╒┐╕┌╒┌╔┬╤',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  258.                 Goto GO_LEFT;
  259.             End;
  260.  
  261.             If (D_Mode = 2) Then
  262.                 Text(Copy('╖╗╓╔╓╔╖╗╖╗╥╦╖╔╖╗╖╗╓╔╥╦',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  263.                 Goto GO_LEFT;
  264.             End;
  265.  
  266.             If (U_Mode = 2) Then
  267.                 Text(Copy('╜╝╙╚╙╚╜╝╜╝╨╩╜╚╜╝╜╝╙╚╨╩',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  268.                 Goto GO_LEFT;
  269.             End;
  270.  
  271.             If (U_Mode = 1) Then
  272.                 Text(Copy('┘╛└╚└╘┘╛┘╛┴╩┘╘┘╛┘╛└╚┴╧',((L_Mode * 8) + (R_Mode * 2)) + Draw_Mode,1));
  273.                 Goto GO_LEFT;
  274.             End;
  275.  
  276. {If no other condition exists...}
  277.             Text(Copy('─═',Draw_Mode,1));
  278.             Goto GO_LEFT;
  279.         END;
  280.     END;
  281.  
  282.     IF (K2 = 72) Then                                                {Up arrow}
  283.         If C_Line = 1 Then
  284.             Goto WAIT_FOR_KEYPRESS;
  285.         End;
  286.         If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move left}
  287.             Up;
  288.             Present_Direction := 0;
  289.             Goto WAIT_FOR_KEYPRESS;
  290.         END;
  291.         If ((K1 = 56) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
  292.             IF (Draw_Mode = 3) THEN
  293.                 Text(' ');
  294.                 Left;
  295.                 Up;
  296.                 Present_Direction := 0;
  297.                 Goto WAIT_FOR_KEYPRESS;
  298.             END;
  299.             If Present_Direction = A_Up Then {If we were previously going a
  300. different direction, then insert char at current cusror position. Otherwise,
  301. insert char in the next left position}
  302.                 Up;
  303.             End;
  304.             Present_Direction := A_Up;
  305.             Call LOOK_AROUND;
  306.  
  307.             Temp_Integer := XPos(D_Char,'┐╕╖╗┌╓╒╔┬╤╦╥',1);
  308.             If (Temp_Integer) Then
  309.                 Down;
  310.                 Text(Copy('┤╡┤╡├├╞╞┼╪╪┼╣╣╢╣╠╟╠╠╬╬╬╫',((Draw_Mode - 1) * 12) + Temp_Integer,1));
  311.                 Goto GO_LEFT;
  312.             End;
  313.  
  314.             If ((D_Mode > 0) and ((R_Mode + U_Mode + L_Mode) = 0)) Then
  315.                 Text(Copy('│║',Draw_Mode,1));
  316.                 Goto GO_LEFT;
  317.             End;
  318.  
  319.             If ((L_Mode = 1) And (R_Mode = 1)) Then
  320.                 Text(Copy('┴╨┬╦╥╥┴╨┴╨┼╬┴╥┴╨╨╩┬╦╫╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  321.                 Goto GO_LEFT;
  322.             End;
  323.  
  324.             If ((L_Mode = 2) And (R_Mode = 2)) Then
  325.                 Text(Copy('╧╩╤╦┬╦╧╩╧╩╪╬┬╦╧╩╧╩╤╩┼╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  326.                 Goto GO_LEFT;
  327.             End;
  328.  
  329.             If (L_Mode = 1) Then
  330.                 Text(Copy('┘╜┐╗┐╖┘╜┘╜┤╣┘╖┘╜┘╜┐╗┤╢',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  331.                 Goto GO_LEFT;
  332.             End;
  333.  
  334.             If (L_Mode = 2) Then
  335.                 Text(Copy('╛╝╕╗╕╗╛╝╛╝╡╣╛╗╛╝╛╝╕╗╡╣',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  336.                 Goto GO_LEFT;
  337.             End;
  338.  
  339.             If (R_Mode = 2) Then
  340.                 Text(Copy('╘╚╒╔╒╔╘╚╘╚╞╠╘╔╘╚╘╚╒╔╞╠',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  341.                 Goto GO_LEFT;
  342.             End;
  343.  
  344.             If (R_Mode = 1) Then
  345.                 Text(Copy('└╙┌╔┌╓└╙└╙├╠└╓└╙└╙┌╔├╟',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  346.                 Goto GO_LEFT;
  347.             End;
  348.  
  349. {If no other condition exists...}
  350.             Text(Copy('│║',Draw_Mode,1));
  351.             Goto GO_LEFT;
  352.         END;
  353.     END;
  354.  
  355.     IF (K2 = 80) Then                                              {Down arrow}
  356.         If ((K1 = 0) and (Shift_Stat = False)) Then {If unshifted, then move right}
  357.             Down;
  358.             Present_Direction := 0;
  359.             Goto WAIT_FOR_KEYPRESS;
  360.         END;
  361.         If ((K1 = 50) or (Shift_Stat = True)) then {If shifted, then insert the appropriate char}
  362.             IF (Draw_Mode = 3) THEN
  363.                 Text(' ');
  364.                 Left;
  365.                 Down;
  366.                 Present_Direction := 0;
  367.                 Goto WAIT_FOR_KEYPRESS;
  368.             END;
  369.             If Present_Direction = A_Down Then {If we were previously going a
  370. different direction, then insert char at current cusror position. Otherwise,
  371. insert char in the next right position}
  372.                 Down;
  373.             End;
  374.             Present_Direction := A_Down;
  375.             Call LOOK_AROUND;
  376.  
  377.             Temp_Integer := XPos(U_Char,'┘╛╜╝└╙╘╚┴╧╩╨',1);
  378.             If (Temp_Integer) Then
  379.                 Up;
  380.                 Text(Copy('┤╡┤╡├├╞╞┼╪╪┼╣╣╢╣╠╟╠╠╬╬╬╫',((Draw_Mode - 1) * 12) + Temp_Integer,1));
  381.                 Goto GO_LEFT;
  382.             End;
  383.  
  384.             If ((U_Mode > 0) and ((R_Mode + D_Mode + L_Mode) = 0)) Then
  385.                 Text(Copy('│║',Draw_Mode,1));
  386.                 Goto GO_LEFT;
  387.             End;
  388.  
  389.             If ((L_Mode = 1) And (R_Mode = 1)) Then
  390.                 Text(Copy('┬╥┬╥╥╦┬╥┴╩┼╬┴╩┬╥╨╨┬╨╫╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  391.                 Goto GO_LEFT;
  392.             End;
  393.  
  394.  
  395.             If ((L_Mode = 2) And (R_Mode = 2)) Then
  396.                 Text(Copy('╤╦╤╦╤╦╤╦╧╩╪╬╧╦╤╦┴╩┴╩┼╬',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  397.                 Goto GO_LEFT;
  398.             End;
  399.  
  400.             If (L_Mode = 1) Then
  401.                 Text(Copy('┐╖┐╖┐╖┐╖┘╝┤╣┘╝┐╖┘╜┐╜┤╢',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  402.                 Goto GO_LEFT;
  403.             End;
  404.  
  405.             If (L_Mode = 2) Then
  406.                 Text(Copy('╕╗╕╗╕╗╕╗╛╝╡╣╛╝╕╗╛╝╕╝╡╣',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  407.                 Goto GO_LEFT;
  408.             End;
  409.  
  410.             If (R_Mode = 2) Then
  411.                 Text(Copy('╒╔╒╔╒╔╒╔╘╚╞╠╘╚╒╔╘╚╒╚╞╠',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  412.                 Goto GO_LEFT;
  413.             End;
  414.  
  415.             If (R_Mode = 1) Then
  416.                 Text(Copy('┌╓┌╓┌╓┌╓└╚├╠└╚┌╓└╙┌╙├╟',((U_Mode * 8) + (D_Mode * 2)) + Draw_Mode,1));
  417.                 Goto GO_LEFT;
  418.             End;
  419.  
  420. {If no other condition exists...}
  421.             Text(Copy('│║',Draw_Mode,1));
  422.             Goto GO_LEFT;
  423.         END;
  424.     END;
  425.  
  426.  
  427. {*****************************************************************************}
  428.     Goto WAIT_FOR_KEYPRESS;
  429.  
  430.  
  431. LOOK_AROUND:
  432. { This subroutine looks at all chars surrounding CUR_CHAR and stores special
  433. values into variables based on what it finds }
  434.  
  435.     If (((C_Row + 2) > Win_Y1) And ((C_Row + 4) < Win_Y2)) Then
  436.         Refresh := False;
  437.     End;
  438.  
  439.     If C_Line > 1 Then
  440.         UP;
  441.         U_Char := Cur_Char;
  442.         RIGHT;
  443.         DOWN;
  444.     Else
  445.         U_Char := '|0';
  446.         Right;
  447.     End;
  448.     R_Char := Cur_Char;
  449.     DOWN;
  450.     LEFT;
  451.     D_Char := Cur_Char;
  452.     If c_col > 1 Then
  453.         LEFT;
  454.         UP;
  455.         L_Char := Cur_Char;
  456.         RIGHT;
  457.     Else
  458.         L_Char := '|0';
  459.         Up;
  460.     End;
  461.     Refresh := True;
  462.  
  463.     D_mode := XPos(D_Char,'│┤╡╛└┴├┼╞╘╪┘╧╢╣║╝╜╟╚╩╠╬╨╙╫',1);
  464.     D_mode := (D_Mode > 0) + (D_Mode > 13);
  465.     U_mode := XPos(U_Char,'│┤╡╕┐┬├┼╞╤╒╪┌╢╖╣║╗╟╔╦╠╬╥╓╫',1);
  466.     U_mode := (U_Mode > 0) + (U_Mode > 13);
  467.     L_mode := XPos(L_Char,'└┴┬├─┼╟╨╥╙╓╫┌╞╚╔╩╦╠═╬╧╤╘╒╪',1);
  468.     L_mode := (L_Mode > 0) + (L_Mode > 13);
  469.     R_mode := XPos(R_Char,'┤╢╖╜┐┴┬─┼╨╥╫┘╡╕╣╗╝╛╩╦═╬╧╤╪',1);
  470.     R_mode := (R_Mode > 0) + (R_Mode > 13);
  471.     RET;
  472.  
  473. END_OF_MAC:
  474.  
  475.     INSERT_MODE := Temp_Insert; { Switch previous insert/overwrite mode }
  476.     Tab_Expand := Temp_Tab_Expand;
  477.     Pop_Labels;
  478.     Undo_Stat := True;
  479.  
  480. END_MACRO;
  481.  
  482. $MACRO ASCII FROM ALL TRANS;
  483. {******************************************************************************
  484.                                                                 MULTI-EDIT MACRO
  485.  
  486. Name: ASCII
  487.  
  488. Description: Displays an ASCII table of the extended IBM character set
  489.  
  490.                             (C) Copyright 1989 by American Cybernetics, Inc.
  491. ******************************************************************************}
  492.  
  493.     DEF_INT( UL_COL, UL_ROW, LR_COL, LR_ROW, RX, CX, CP , CI);
  494.     Def_Str(Temp_String);
  495.  
  496.     UL_COL := 3;
  497.     UL_ROW := 4;
  498.     LR_COL := 75;
  499.     LR_ROW := 24;
  500.  
  501.     PUT_BOX(UL_COL,UL_ROW,LR_COL,LR_ROW,0,m_B_COLOR,'ASCII─TABLE',true);
  502.     GOTOXY(1,SCREEN_LENGTH + 1 );
  503.  
  504.     Set_Global_Str('EVASCII1',
  505.             '/T=Prev.Page/KC=<UP>/W=13/K1=0/K2=72/R=1/Y=' + str(lr_row - 2) +
  506.                                     '/X=' + str( ul_col + 10 ));
  507.     Set_Global_Str('EVASCII2',
  508.             '/T=Next Page/KC=<DOWN>/W=15/K1=0/K2=80/R=2/Y=' + str(lr_row - 2) +
  509.                                     '/X=' + str( ul_col + 28 ));
  510.     Set_Global_Str('EVASCII3',
  511.             '/T=Done/KC=<ESC>/W=9/K1=27/K2=1/R=3/Y=' + str(lr_row - 2) +
  512.                                     '/X=' + str( ul_col + 47 ));
  513.     Set_Global_Str('EVASCII4','/K1=0/K2=73/R=1/ND=1');
  514.     Set_Global_Str('EVASCII5','/K1=0/K2=81/R=2/ND=1');
  515.     Set_Global_Str('EVASCII6','/K1=13/K2=28/R=3/ND=1');
  516.  
  517.     CP := Global_Int('ASCII_PAGE');
  518.     IF (CP = 3) THEN
  519.         Goto START_PAGE3;
  520.     END;
  521.     IF (CP = 2) THEN
  522.         Goto START_PAGE2;
  523.     END;
  524.  
  525. START_PAGE1:
  526.  
  527.     CP := 1;
  528.     RX := UL_ROW + 1;
  529.     CX := UL_COL + 1;
  530.  
  531.     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';
  532.     Call WRITE_TABLE;
  533.     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';
  534.     Call WRITE_TABLE;
  535.     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';
  536.     Call WRITE_TABLE;
  537.     Temp_String := '09 09 |9  ^I HT  │ 25 19   ^Y EM  │  41 29  ) │  57 39  9 │  73 49  I10 0A 
  538.   ^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';
  539.     Call WRITE_TABLE;
  540.     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';
  541.     Call WRITE_TABLE;
  542.     Temp_String := '15 0F   ^O SI  │ 31 1F   ^_ US  │  47 2F  / │  63 3F  ? │  79 4F  O────────────────┴─────────────────┴───────────┴───────────┴──────────';
  543.     Call WRITE_TABLE;
  544.  
  545.     RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
  546.     KEY_LOOP1:
  547.         READ_KEY;
  548.         IF (KEY1 = 0) AND (KEY2 = 250) THEN
  549.             RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
  550.             IF return_int = 0 THEN
  551.                 Push_Key(Key1,Key2);
  552.                 Goto Do_End;
  553.             END;
  554.         ELSE
  555.             RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
  556.         END;
  557.         IF Return_Int <> 0 THEN
  558.             Return_Int := Parse_Int('/R=', return_str );
  559.             IF Return_Int = 1 THEN
  560.                 Goto Start_Page3;
  561.             ELSIF Return_Int = 2 THEN
  562.                 Goto Start_Page2;
  563.             ELSIF Return_Int = 3 THEN
  564.                 Goto Do_End;
  565.             END;
  566.         END;
  567.         Goto KEY_LOOP1;
  568.  
  569. START_PAGE2:
  570.     CP := 2;
  571.  
  572.     RX := UL_ROW + 1;
  573.     CX := UL_COL + 1;
  574.  
  575.  
  576.  
  577.     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  ó ';
  578.     Call WRITE_TABLE;
  579.     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  Ñ ';
  580.     Call WRITE_TABLE;
  581.     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  ¿ ';
  582.     Call WRITE_TABLE;
  583.     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  ½ ';
  584.     Call WRITE_TABLE;
  585.     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  « ';
  586.     Call WRITE_TABLE;
  587.     Temp_String := '95 5F  _ │ 111 6F  o │ 127 7F   │ 143 8F  Å │ 159 9F  ƒ │ 175 AF  » ─────────┴───────────┴───────────┴───────────┴───────────┴────────── ';
  588.     Call WRITE_TABLE;
  589.  
  590.     RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
  591.     KEY_LOOP2:
  592.         READ_KEY;
  593.         IF (KEY1 = 0) AND (KEY2 = 250) THEN
  594.             RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
  595.             IF return_int = 0 THEN
  596.                 Push_Key(Key1,Key2);
  597.                 Goto Do_End;
  598.             END;
  599.         ELSE
  600.             RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
  601.         END;
  602.         IF Return_Int <> 0 THEN
  603.             Return_Int := Parse_Int('/R=', return_str );
  604.             IF Return_Int = 1 THEN
  605.                 Goto Start_Page1;
  606.             ELSIF Return_Int = 2 THEN
  607.                 Goto Start_Page3;
  608.             ELSIF Return_Int = 3 THEN
  609.                 Goto Do_End;
  610.             END;
  611.         END;
  612.         Goto KEY_LOOP2;
  613.  
  614. START_PAGE3:
  615.     CP := 3;
  616.  
  617.     RX := UL_ROW + 1;
  618.     CX := UL_COL + 1;
  619.  
  620.     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  ≥ │          ';
  621.     Call WRITE_TABLE;
  622.     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  ⌡ │          ';
  623.     Call WRITE_TABLE;
  624.     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  ° │          ';
  625.     Call WRITE_TABLE;
  626.     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  √ │          ';
  627.     Call WRITE_TABLE;
  628.     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  ■ │          ';
  629.     Call WRITE_TABLE;
  630.     Temp_String := '191 BF  ┐ │ 207 CF  ╧ │ 223 DF  ▀ │ 239 EF  ∩ │ 255 FF    │          ──────────┴───────────┴───────────┴───────────┴───────────┴──────────';
  631.     Call WRITE_TABLE;
  632.  
  633.     RM('USERIN^CheckEvents /M=2/G=EVASCII/#=6');
  634.     KEY_LOOP3:
  635.         READ_KEY;
  636.         IF (KEY1 = 0) AND (KEY2 = 250) THEN
  637.             RM('USERIN^CheckEvents /M=1/G=EVASCII/#=6');
  638.             IF return_int = 0 THEN
  639.                 Push_Key(Key1,Key2);
  640.                 Goto Do_End;
  641.             END;
  642.         ELSE
  643.             RM('USERIN^CheckEvents /M=0/G=EVASCII/#=6');
  644.         END;
  645.         IF Return_Int <> 0 THEN
  646.             Return_Int := Parse_Int('/R=', return_str );
  647.             IF Return_Int = 1 THEN
  648.                 Goto Start_Page2;
  649.             ELSIF Return_Int = 2 THEN
  650.                 Goto Start_Page1;
  651.             ELSIF Return_Int = 3 THEN
  652.                 Goto Do_End;
  653.             END;
  654.         END;
  655.         Goto KEY_LOOP3;
  656.  
  657. WRITE_TABLE:
  658.     CI := 0;
  659.     While (CI < 3) Do
  660.         WRITE(Copy(Temp_String,(CI * 69) + 1,69),CX,RX,0,M_T_COLOR);
  661.         ++ RX;
  662.         ++ CI;
  663.     End;
  664.     RET;
  665.  
  666. DO_END:
  667.     RM('USERIN^CheckEvents /M=3/G=EVASCII/#=6');
  668.     Set_Global_Int('ASCII_PAGE',CP);
  669.     KILL_BOX;
  670. END_MACRO;
  671.  
  672. $MACRO CONDENSE FROM EDIT TRANS;
  673. {******************************************************************************
  674.                                                              MULTI-EDIT MACRO
  675.  
  676. NAME:  CONDENSE
  677.  
  678. DESCRIPTION:  Displays the current file so that only the lines that start on
  679.                             or before a set cutoff point or according to a search expression
  680.                             are shown. allows the user to move quickly through the file.
  681.  
  682. Global Variables:
  683.     Global_Int('Condense_Mode')
  684.         0 = Use cutoff column
  685.         1 = Use search expression
  686.  
  687.     Global_Str('Condense_Search')
  688.         Contains the last used search expression
  689.  
  690.     Global_Str('Condense_Switches')
  691.         Contains the list used search switches
  692.  
  693.     Global_Int('Cutoff_Col')
  694.         Contains the last used cutoff column
  695.  
  696.                              (C) Copyright 1989 by American Cybernetics, Inc.
  697. ******************************************************************************}
  698.  
  699.     Def_Int(Cutoff_Col,Up_Count,Temp_Line_Num,New_Line_Num,At_Top,At_Bottom,
  700.                     Temp_Integer,Good_Input,Line_Amount,Text_Window,Line_Window,Repaint,
  701.                     Left_Side,Width,Top,Write_Line,X2,Y2,Start_Line,Cursor_Line,Counter,
  702.                     Normal,Temp_Tab_Expand,Using_Search,Temp_Reg_Exp_Stat,
  703.                     Temp_Insert_Mode,Temp_Ignore_Case, twin,Scroll_Pos,T_Mou_X,T_Mou_Y);
  704.     Def_Str(Blank_Line,Temp_String,Search_String,Search_Switches[8],Temp_Search);
  705.  
  706. {Variables for special elapsed time code
  707.     Def_Int(Start_Minutes,Start_Seconds,End_Minutes,End_Seconds);
  708. }
  709.  
  710.     Temp_Reg_Exp_Stat := Reg_Exp_Stat;
  711.     Temp_Ignore_Case := Ignore_Case;
  712.     Temp_Tab_Expand := Tab_Expand;
  713.     Temp_Insert_Mode := Insert_Mode;
  714.     Tab_Expand := False;
  715.     Undo_Stat := False;
  716.     Insert_Mode := True;
  717.     Using_Search := Global_Int('Condense_Mode');
  718.     Search_String := Global_Str('Condense_Search');
  719.     IF (Search_String = '') THEN
  720.         Search_String := Global_Str('Search_Str');
  721.     END;
  722.     IF (Search_String = '') THEN
  723.         Using_Search := False;
  724.     END;
  725.     Temp_Search := Search_String;
  726.  
  727.     Search_Switches := Global_Str('Condense_Switches');
  728.     IF (Search_Switches = '') THEN
  729.         IF (XPos('I',Caps(Global_Str('Switches')),1)) THEN
  730.             Search_Switches := 'I';
  731.         END;
  732.         IF (XPos('X',Caps(Global_Str('Switches')),1)) THEN
  733.             Search_Switches := Search_Switches + 'X';
  734.         END;
  735.     END;
  736.     Ignore_Case := (XPos('I',Search_Switches,1) > 0);
  737.     Reg_Exp_Stat := (XPos('X',Search_Switches,1) = 0);
  738.     If (Global_Int('Cutoff_Col') < 1) Then
  739.         Set_Global_Int('Cutoff_Col',1);
  740.     End;
  741.     If (Global_Int('Cutoff_Col') > 18) Then
  742.         Set_Global_Int('Cutoff_Col',18);
  743.     End;
  744.     Cutoff_Col := Global_Int('Cutoff_Col');
  745.     IF ((Not(Using_Search)) and (Cutoff_Col = 1)) THEN
  746.         Reg_Exp_Stat := True;
  747.         Search_String := '%[~ |9|0]';
  748.     END;
  749.     Push_Labels;
  750.     FLABEL('Help',1,$FF);
  751.     Flabel('Column',2,$FF);
  752.     Flabel('Search',3,$FF);
  753.     Messages := False;
  754.     Left_Side := Win_X1 + 2;
  755.     Cursor_Line := Win_Y1 + 1;
  756.     Width := (Win_X2 - Win_X1) - 1;
  757.     Top := Win_Y1 + 1;
  758.     Line_Amount := (Win_Y2 - Win_Y1) - 1;
  759.     X2 := Win_X2;
  760.     Y2 := Win_Y2;
  761.     Blank_Line := Copy('                                                                                ',1,Width);
  762.     Text_Window := Cur_Window;
  763.     Temp_Line_Num := C_Line;
  764.     Refresh := False;
  765.     Normal := True;
  766.  
  767.     Create_Window;
  768. {make window the same as the text window}
  769.     Window_Attr := $80;
  770.     Size_Window(Left_Side - 2,Top - 1,X2,Y2);
  771.     Line_Window := Cur_Window;
  772.     Switch_Window(Text_Window);
  773.     Repaint := False;
  774.     At_Top := False;
  775.     At_Bottom := False;
  776.     Write(Copy('════════════════════════════════════════',1,Width / 2),Win_X1 + 1,Win_Y1,0,B_Color);
  777.     Write('CONDENSED',(Width / 2) - 5,Win_Y1,0,B_Color);
  778.     Make_Message('');
  779.     Start_Line := Temp_Line_Num;
  780.     Up_Count := Line_Amount / 2;
  781.     Call GET_LINES;
  782.     Call GET_LINE_NUM;
  783.     If (Check_Key) Then
  784.     End;
  785.  
  786. MAIN_LOOP:
  787. {
  788. Make_Message('AT_TOP=' + Str(AT_TOP) + ' AT_BOTTOM=' + STR(AT_BOTTOM) +
  789.                             ' LINE_AMOUT=' + Str(LINE_AMOUNT) + ' C_LINE=' + Str(C_Line));
  790. }
  791.     Read_Key;
  792.     Insert_Mode := True;
  793.     IF ((Key1 = 27) or (Key1 = 13)) THEN
  794.         Goto LOOP_EXIT;
  795.     END;
  796.     IF (Key1 = 0) THEN
  797.         IF ((Key2 = 244) or (Key2 = 245)) THEN
  798.             Goto LOOP_EXIT;
  799.         END;
  800.         Call GET_KEY;
  801.     END;
  802.     Goto MAIN_LOOP;
  803.  
  804. LOOP_EXIT:
  805.     Switch_Window(Line_Window);
  806.     Temp_Integer := Val(New_Line_Num,Get_Line);
  807.     If ((Key1 = 27) or (New_Line_Num = 0) or (Key2 = 245)) Then
  808.         New_Line_Num := Temp_Line_Num;
  809.     End;
  810.  
  811.     Delete_Window;
  812.  
  813.     Switch_Window(Text_Window);
  814.  
  815. {These 6 lines will center the selected line on the screen if possible}
  816.  
  817.     Refresh := True;
  818.  
  819.     WHILE (C_Row > ((Win_Y2 - Win_Y1) / 2)) DO
  820.         Up;
  821.     END;
  822.     WHILE (C_Row < ((Win_Y2 - Win_Y1) / 2)) DO
  823.         Down;
  824.     END;
  825.     Goto_Line(New_Line_Num);
  826.     goto_col(Cutoff_Col);
  827.     Goto END_OF_MAC;
  828.  
  829. GET_LINES:
  830.     Switch_Window(Line_Window);
  831. {special development code for calculating elapsed time
  832. If ((Val(Start_Minutes,Copy(Time,4,2))) and (Val(Start_Seconds,Copy(Time,7,2)))) Then
  833. End;
  834. }
  835.  
  836. {Determine the line to start looking at}
  837.     If ((Up_Count > 0) or (Repaint = True)) Then
  838.         Tof;
  839.     Else
  840.         Goto_Line(Line_Amount);
  841.     End;
  842.  
  843.     If (Get_Line <> '') Then
  844.         Temp_Integer := Val(Start_Line,Get_Line);
  845.     Else
  846.         Start_Line := Temp_Line_Num;
  847.     End;
  848. GET_LINES2:
  849. {Clear displayed lines}
  850.     Temp_Integer := Top + Line_Amount;
  851.     Counter := Top;
  852.     While (Counter < Temp_Integer) Do
  853.         Write(Blank_Line,Left_Side - 1,Counter,0,Text_Color);
  854.         ++Counter;
  855.     End;
  856.  
  857.     Tof;
  858. {Delete all lines in line number file}
  859.     While Not(At_Eof) Do
  860.         Del_Line;
  861.     End;
  862. {Find top line}
  863.     Switch_Window(Text_Window);
  864.     If (Normal = True) Then
  865.         Goto_Line(Start_Line);
  866.     End;
  867.  
  868.     At_Top := False;
  869.  
  870.     If (Up_Count = 0) Then
  871.         Goto PAGING_DOWN;
  872.     End;
  873.  
  874.     If (Repaint) Then
  875.         Repaint := False;
  876.         Switch_Window(Text_Window);
  877.         Goto PAGING_DOWN;
  878.     End;
  879.  
  880.     Counter := Up_Count;
  881. SEEK_UP:
  882.     If ((Using_Search) or (Cutoff_Col = 1)) Then
  883.         If (Search_Bwd(Search_String,0)) Then
  884.             Temp_String := Str(C_Line);
  885.             Switch_Window(Line_Window);
  886.             Cr;
  887.             Up;
  888.             Put_Line(Temp_String);
  889.             Switch_Window(Text_Window);
  890.             --Counter;
  891.             If (C_Line = 1) Then
  892.                 Goto TOP_FOUND;
  893.             End;
  894.             Up;
  895.             goto_col(1);
  896.             IF (Counter > 0) THEN
  897.                 Goto SEEK_UP;
  898.             END;
  899.         ELSE
  900.             IF (Error_Level) THEN
  901.                 RM('MEERROR');
  902.                 Ret;
  903.             END;
  904.             At_Top := True;
  905.         End;
  906.     ELSE
  907.             First_Word;
  908.             If ((c_col <= Cutoff_Col) and (Not(At_Eol))) Then
  909.                 Temp_String := Str(C_Line);
  910.                 Switch_Window(Line_Window);
  911.                 Cr;
  912.                 Up;
  913.                 Put_Line(Temp_String);
  914.                 Switch_Window(Text_Window);
  915.                 --Counter;
  916.             End;
  917.             If (C_Line = 1) Then
  918.                 Goto TOP_FOUND;
  919.             End;
  920.             Up;
  921.             IF (Counter > 0) THEN
  922.                 Goto SEEK_UP;
  923.             END;
  924.     END;
  925.  
  926. TOP_FOUND:
  927.     At_Top := (C_Line = 1) or (At_Top);
  928.     Down;
  929.     Switch_Window(Line_Window);
  930.     Tof;
  931.  
  932.     While (Up_Count > Counter) Do
  933.         Switch_Window(Line_Window);
  934.         Good_Input := Val(Temp_Integer,Get_Line);
  935.         Write_Line := (C_Line + Top) - 1;
  936.         Down;
  937.         Switch_Window(Text_Window);
  938.         Goto_Line(Temp_Integer);
  939.         Write(Copy(Get_Line,1,Width),Left_Side - 1,Write_Line,0,Text_Color);
  940.         --Up_Count;
  941.     End;
  942.  
  943.     Switch_Window(Text_Window);
  944.     Down;
  945. PAGING_DOWN:
  946.     At_Top := (C_Line = 1) or (At_Top);
  947.  
  948.     At_Bottom := False;
  949.     Switch_Window(Line_Window);
  950.     Write_Line := (C_Line + Top) - 2;
  951.     Counter := C_Line;
  952.     Switch_Window(Text_Window);
  953.     If (Counter > Line_Amount) Then
  954.         Goto NO_MORE_LINES;
  955.     END;
  956.  
  957. SEEK_DOWN:
  958.     If ((Using_Search) or (Cutoff_Col = 1)) Then
  959.         If (Search_Fwd(Search_String,0)) Then
  960.             Temp_Integer := C_Line;
  961.             Switch_Window(Line_Window);
  962.             Put_Line(Str(Temp_Integer));
  963.             Down;
  964.             Switch_Window(Text_Window);
  965.             Write(Copy(Get_Line,1,Width),Left_Side - 1,(Counter + Top) - 1,0,Text_Color);
  966.             Down;
  967.             goto_col(1);
  968.             ++Counter;
  969.             If (At_Eof) Then
  970.                 Goto NO_MORE_LINES;
  971.             End;
  972.             IF (Counter <= Line_Amount) THEN
  973.                 Goto SEEK_DOWN;
  974.             END;
  975.         ELSE
  976.             IF (Error_Level) THEN
  977.                 RM('MEERROR');
  978.                 Ret;
  979.             END;
  980.             At_Bottom := True;
  981.         End;
  982.     ELSE
  983.             First_Word;
  984.             While ((c_col > Cutoff_Col) or (At_Eol)) Do
  985.                 Down;
  986.                 First_Word;
  987.                 If (At_Eof) Then
  988.                     Goto NO_MORE_LINES;
  989.                 End;
  990.             End;
  991.  
  992.             Temp_Integer := C_Line;
  993.             Switch_Window(Line_Window);
  994.             Put_Line(Str(Temp_Integer));
  995.             Down;
  996.             Switch_Window(Text_Window);
  997.             Write(Copy(Get_Line,1,Width),Left_Side - 1,(Counter + Top) - 1,0,Text_Color);
  998.             Down;
  999.             ++Counter;
  1000.             IF (Counter <= Line_Amount) THEN
  1001.                 Goto SEEK_DOWN;
  1002.             END;
  1003.     END;
  1004.  
  1005. NO_MORE_LINES:
  1006.     At_Bottom := (At_Eof) or (At_Bottom);
  1007.     Switch_Window(Line_Window);
  1008.     Tof;
  1009.     If (Search_FWD(Str(Start_Line),0)) Then
  1010.     End;
  1011.     goto_col(1);
  1012.  
  1013.     Cursor_Line := C_Line + Win_Y1;
  1014.     GotoXY(Left_Side - 1,Cursor_Line);
  1015. {special development code to determine elapsed time
  1016. If ((Val(End_Minutes,Copy(Time,4,2))) and (Val(End_Seconds,Copy(Time,7,2)))) Then
  1017. End;
  1018. If (Start_Seconds > End_Seconds) Then
  1019.     End_Seconds := End_Seconds + 60;
  1020.     --End_Minutes;
  1021. End;
  1022. If (Start_Minutes > End_Minutes) Then
  1023.     End_Minutes := End_Minutes + 60;
  1024. End;
  1025. Make_Message('Old Elapsed time ' + Str(End_Minutes - Start_Minutes) + ':' + Str(End_Seconds - Start_Seconds));
  1026. Read_Key;
  1027. }
  1028.     RET;
  1029.  
  1030. GET_KEY:
  1031.     IF (Key2 = 251) THEN
  1032.         IF (Mou_Last_X = Win_X2) AND (Mou_Last_y > (win_y1 + 1)) AND
  1033.             (Mou_Last_y < (win_y2 - 1)) THEN
  1034.             Switch_Window(Text_Window);
  1035.             RM('MOUSE^GotoScrollBar');
  1036.             Start_Line := C_Line;
  1037.             Switch_Window(Line_Window);
  1038.             Erase_Window;
  1039.             Up_Count := Line_Amount / 2;
  1040.             Call GET_LINES2;
  1041.             Call GET_LINE_NUM;
  1042.             Ret;
  1043.         END;
  1044.     END;
  1045.     IF (Key2 = 250) THEN
  1046.         T_Mou_X := Mou_Last_X;
  1047.         T_Mou_Y := Mou_Last_Y;
  1048.         IF (Mou_Last_X = Win_X2) THEN
  1049.             IF (mou_last_y = (win_y2 - 1)) THEN
  1050.                 Goto SCROLL_UP;
  1051.             ELSIF (mou_last_y = (win_y1 + 1)) THEN
  1052.                 Goto SCROLL_DOWN;
  1053.             ELSIF (Mou_Last_y > win_y1) AND (Mou_Last_y < win_y2) THEN
  1054.                 Temp_Integer := Mou_Last_Y - Win_Y1 - 1;
  1055.                 Switch_Window(Text_WIndow);
  1056.                 Scroll_Pos := Cur_Scroll_Pos;
  1057.                 Switch_Window(Line_WIndow);
  1058.                 IF (Temp_Integer > scroll_pos) THEN
  1059.                     Goto page_down;
  1060.                 ELSIF (Temp_Integer < scroll_pos) THEN
  1061.                     Goto page_up;
  1062.                 END;
  1063.             END;
  1064.         ELSIF (Mou_Last_Y = Fkey_ROW) THEN
  1065.             RM('MOUSE^MOUSEFKEY');
  1066.             Ret;
  1067.         ELSIF ((Mou_Last_Y > Win_Y1) and (Mou_Last_Y < Win_Y2) and
  1068.                     (Mou_Last_X > Win_X1) and (Mou_Last_X < Win_X2)) THEN
  1069. {Check to see if mouse was clicked inside the window}
  1070.             Counter := C_Line;
  1071.             Goto_Line(Mou_Last_Y - Win_Y1);
  1072.             IF (At_Eof) THEN
  1073.                 Goto_Line(Counter);
  1074.             END;
  1075.             Cursor_Line := C_Line + Win_Y1;
  1076.             GotoXY(Left_Side - 1,Cursor_Line);
  1077.         ELSE
  1078.             RM('USERIN^CHECKEVENTS /M=1/G=CONDENSEEV/#=3');
  1079.             IF (Return_Int) THEN
  1080.                 Push_Key(Parse_Int('/K1=',Global_Str('CONDENSEEV' + Str(Return_Int))),
  1081.                                  Parse_Int('/K2=',Global_Str('CONDENSEEV' + Str(Return_Int))));
  1082.                 Ret;
  1083.             END;
  1084.         END;
  1085.     END;
  1086.     If ((Key2 = 72) or (Key2 = 240)) Then {Up arrow}
  1087.         If (C_line > 1) Then
  1088.             Up;
  1089.             Eol;
  1090.             --Cursor_Line;
  1091.             GotoXY(Left_Side - 1,Cursor_Line);
  1092.         Else
  1093. SCROLL_DOWN:
  1094.             If Not(At_Top) Then {Scroll down}
  1095.                 Counter := C_Line;
  1096. {Check for at bottom}
  1097.                 Switch_Window(Line_Window);
  1098.                 Goto_Line(Line_Amount);
  1099.                 Goto_Col(1);
  1100.                 At_Bottom := At_Eof;
  1101.                 Del_Line;
  1102. {Goto the top line}
  1103.                 Tof;
  1104.                 Temp_Integer := Val(Start_Line,Get_Line);
  1105. {Look for the next line up in the text file}
  1106.                 Switch_Window(Text_Window);
  1107.                 Goto_Line(Start_Line);
  1108.                 Up;
  1109.                 Eol;
  1110.                 If ((Using_Search) or (Cutoff_Col = 1)) Then
  1111.                     If (Search_Bwd(Search_String,0)) Then
  1112.                         Temp_Integer := C_Line;
  1113.                         Scroll_Box_Dn(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
  1114.                         Write(Copy(Get_Line,1,Width),Left_Side - 1,Top,0,Text_Color);
  1115.                         At_Top := (C_Line = 1);
  1116.                         Switch_Window(Line_Window);
  1117. {Delete bottom line}
  1118.                         Goto_Line(Line_Amount);
  1119.                         Del_Line;
  1120. {Goto the top line and insert new line above it}
  1121.                         Tof;
  1122.                         Cr;
  1123.                         Up;
  1124.                         Put_Line(Str(Temp_Integer));
  1125.                     ELSE
  1126.                         At_Top := True;
  1127.                     End;
  1128.                 ELSE
  1129.                         First_Word;
  1130.                         While ((c_col > Cutoff_Col) or (At_Eol)) Do
  1131.                             Up;
  1132.                             First_Word;
  1133.                             If (C_Line = 1) Then
  1134.                                 At_Top := True;
  1135.                                 Goto No_Scroll_Down;
  1136.                             End;
  1137.                         End;
  1138.                         At_Top := (C_Line = 1);
  1139.             Temp_Integer := C_Line;
  1140.                         Scroll_Box_Dn(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
  1141.                         Write(Copy(Get_Line,1,Width),Left_Side - 1,Top,0,Text_Color);
  1142.                         Switch_Window(Line_Window);
  1143. {Delete bottom line}
  1144.                         Goto_Line(Line_Amount);
  1145.                         Del_Line;
  1146. {Goto the top line and insert new line above it}
  1147.                         Tof;
  1148.                         Cr;
  1149.                         Up;
  1150.                         Put_Line(Str(Temp_Integer));
  1151.                 END;
  1152. NO_SCROLL_DOWN:
  1153.                 Switch_Window(Line_Window);
  1154.                 IF (Key2 = 250) THEN
  1155.                     Goto_Line(Counter);
  1156.                     Mou_Repeat := True;
  1157. CHECK_STAT2:
  1158.                     Mou_Check_Status;
  1159.                     IF ((Mou_Last_Status AND 1) = 0) OR (T_Mou_x <> Mou_Last_X) OR
  1160.                             (T_Mou_y <> Mou_Last_Y) THEN
  1161.                         GOTO MOU_SCROLL_DOWN_EXIT;
  1162.                     END;
  1163.                     IF check_key THEN
  1164.                         IF (key1 <> 0) AND (key2 <> 250) THEN
  1165.                             push_key(key1, key2);
  1166.                             GOTO MOU_SCROLL_DOWN_EXIT;
  1167.                         END;
  1168.                         Call GET_LINE_NUM;
  1169.                         goto scroll_DOWN;
  1170.                     END;
  1171.                     goto CHECK_STAT2;
  1172. MOU_SCROLL_DOWN_EXIT:
  1173.                     Mou_Repeat := False;
  1174.                 END;
  1175.             End;
  1176.         End;
  1177.     End;
  1178.  
  1179.     If ((Key2 = 80) or (Key2 = 241)) Then {Down arrow}
  1180.         If ((C_line < Line_Amount) and (Not(At_Eof))) Then
  1181.             Down;
  1182.             Eol;
  1183.             ++Cursor_Line;
  1184.             GotoXY(Left_Side - 1,Cursor_Line);
  1185.         Else
  1186. SCROLL_UP:
  1187.             If Not(At_Bottom) Then {Scroll up}
  1188.                 Counter := C_Line;
  1189. {Goto the bottom line}
  1190.                 Goto_Line(Line_Amount);
  1191.                 Temp_Integer := Val(Start_Line,Get_Line);
  1192.                 Switch_Window(Text_Window);
  1193.                 Goto_Line(Start_Line);
  1194.                 Eol;
  1195.                 If (At_Eof) Then
  1196.                     At_Bottom := True;
  1197.                     Goto NO_SCROLL_UP;
  1198.                 End;
  1199.  
  1200. {Delete top line in line window}
  1201.                 At_Top := False;
  1202.                 Switch_Window(Line_Window);
  1203.                 Tof;
  1204.                 Del_Line;
  1205.                 Goto_Line(Line_Amount);
  1206.                 Scroll_Box_UP(Left_Side - 1,Top,X2 - 1,Y2 - 1,(Back_Color shl 4) or Text_Color);
  1207.  
  1208. {Look for the next line down in the text file}
  1209.                 Switch_Window(Text_Window);
  1210.                 If ((Using_Search) or (Cutoff_Col = 1)) Then
  1211.                     If (Search_Fwd(Search_String,0)) Then
  1212.                         Temp_Integer := C_Line;
  1213.                         Switch_Window(Text_Window);
  1214.                         Write(Copy(Get_Line,1,Width),Left_Side - 1,Top + Line_Amount - 1,0,Text_Color);
  1215.                         Eol;
  1216.                         At_Bottom := At_Eof;
  1217.                         Switch_Window(Line_Window);
  1218.                         Put_Line(Str(Temp_Integer));
  1219.                     ELSE
  1220.                         At_Bottom := True;
  1221.                     End;
  1222.                 ELSE
  1223.                     Down;
  1224.                     First_Word;
  1225.                     While ((c_col > Cutoff_Col) or (At_Eol)) Do
  1226.                         Down;
  1227.                         First_Word;
  1228.                         If (At_Eof) Then
  1229.                             At_Bottom := True;
  1230.                             Goto No_Scroll_Up;
  1231.                         End;
  1232.                     End;
  1233.                     Temp_Integer := C_Line;
  1234.                     Write(Copy(Get_Line,1,Width),Left_Side - 1,Top + Line_Amount - 1,0,Text_Color);
  1235.                     At_Bottom := At_Eof;
  1236.                     Switch_Window(Line_Window);
  1237.                     Put_Line(Str(Temp_Integer));
  1238.                 END;
  1239. NO_SCROLL_UP:
  1240.                 Switch_Window(Line_Window);
  1241.                 IF (Key2 = 250) THEN
  1242.                     Goto_Line(Counter);
  1243.                     Mou_Repeat := True;
  1244. CHECK_STAT1:
  1245.                     Mou_Check_Status;
  1246.                     IF ((Mou_Last_Status AND 1) = 0) OR (T_Mou_x <> Mou_Last_X) OR
  1247.                             (T_Mou_y <> Mou_Last_Y) THEN
  1248.                         GOTO MOU_SCROLL_UP_EXIT;
  1249.                     END;
  1250.                     IF check_key THEN
  1251.                         IF (key1 <> 0) AND (key2 <> 250) THEN
  1252.                             push_key(key1, key2);
  1253.                             GOTO MOU_SCROLL_UP_EXIT;
  1254.                         END;
  1255.                         Call GET_LINE_NUM;
  1256.                         goto scroll_up;
  1257.                     END;
  1258.                     goto CHECK_STAT1;
  1259. MOU_SCROLL_UP_EXIT:
  1260.                     Mou_Repeat := False;
  1261.                 END;
  1262.             End;
  1263.         End;
  1264.     End;
  1265.     If (Key2 = 73) Then
  1266. PAGE_UP:
  1267.         If (At_Top) Then {Page up}
  1268.             Tof;
  1269.             Cursor_Line := Win_Y1 + 1;
  1270.             GotoXY(Left_Side - 1,Cursor_Line);
  1271.         Else
  1272.             Up_Count := Line_Amount;
  1273.             Call GET_LINES;
  1274.         End;
  1275.     End;
  1276.     If (Key2 = 81) Then
  1277. PAGE_DOWN:
  1278.     Goto_Col(1);
  1279.         If (At_Bottom) Then {Page down}
  1280.             WHILE Not(AT_EOF) DO
  1281.                 Down;
  1282.                 ++Cursor_Line;
  1283.             END;
  1284.             Up;
  1285.             --Cursor_Line;
  1286.             GotoXY(Left_Side - 1,Cursor_Line);
  1287.         Else
  1288.             Up_Count := 0;
  1289.             Call GET_LINES;
  1290.         End;
  1291.     End;
  1292.     If ((Key2 = 119) and (Not(At_Top))) Then {Top of file}
  1293.         Switch_Window(Text_Window);
  1294.         Tof;
  1295.         Up_Count := 0;
  1296.         Normal := False;
  1297.         Call GET_LINES;
  1298.         Normal := True;
  1299.         At_Top := True;
  1300.     End;
  1301.     If ((Key2 = 117) and (Not(At_Bottom))) Then {Bottom_Of_File}
  1302.         Switch_Window(Text_Window);
  1303.         Eof;
  1304.         goto_col(1);
  1305.         While (At_Eol) Do
  1306.             Up;
  1307.         End;
  1308.         Up_Count := Line_Amount;
  1309.         Normal := False;
  1310.         Call GET_LINES;
  1311.         Goto_Line(Line_Amount);
  1312.         Cursor_Line := C_Line + Win_Y1;
  1313.         GotoXY(Left_Side - 1,Cursor_Line);
  1314.         Normal := True;
  1315.         At_Bottom := True;
  1316.     End;
  1317.  
  1318.     If (Key2 = 59) Then {F1(Help)}
  1319.      HELP('CN');
  1320.     End;
  1321.     If (Key2 = 60) Then {F2(set cutoff column)}
  1322.         Make_Message('');
  1323.         Return_Int := Cutoff_Col;
  1324.         RM('userin^QUERYBOX /N=1/P=Display lines with text beginning at or before' +
  1325.                             ' column:/MIN=1/MAX=254/H=CC/C=1/L=2/W=2/T=SET CUTOFF COLUMN');
  1326.         IF ((Return_Str = 'FALSE') and (Using_Search = True)) THEN
  1327. {If they pressed <ESC> and we are not already using cutoff column, then go back
  1328. to using search}
  1329.             Goto DO_SEARCH;
  1330.         END;
  1331.         Set_Global_Int('Cutoff_Col',Return_Int);
  1332.         Cutoff_Col := Return_Int;
  1333. DO_CUTOFF:
  1334.         Repaint := True;
  1335.         At_Top := False;
  1336.         At_Bottom := False;
  1337.         IF (Cutoff_Col = 1) THEN
  1338.             Reg_Exp_Stat := True;
  1339.             Search_String := '%[~ |9|0]';
  1340.         END;
  1341.         Using_Search := False;
  1342.         Set_Global_Int('Condense_Mode',False);
  1343.         Call GET_LINES;
  1344.         Repaint := False;
  1345.     End;
  1346.  
  1347.     If (Key2 = 61) Then {F3(set search string)}
  1348.         Make_Message('');
  1349.         Search_String := Temp_Search;
  1350.         Set_Global_Str('CMISTR_1', Search_String );
  1351.         Set_Global_Str('CMIPARM_1', '/T=Search for:/C=1/L=1/W=64' );
  1352.     Set_Global_Str('CMIPARM_2','/T=>>>>/TP=6/C=1/L=2/W=6');
  1353.     Set_Global_Str('CMISTR_2' , 'ACCEPT');
  1354.  
  1355.         Set_Global_Str('CMISTR_3' ,'/T=X');
  1356.         Set_Global_Int('CMIINT_3' , Xpos('I',Search_Switches,1) = 0);
  1357.         Set_Global_Str('CMIPARM_3','/TP=5/T=Case sensitive:     /C=1/W=1/L=3');
  1358.  
  1359.         Set_Global_Str('CMISTR_4' ,'/T=X');
  1360.         Set_Global_Int('CMIINT_4' , Xpos('X',Search_Switches,1) = 0);
  1361.         Set_Global_Str('CMIPARM_4','/TP=5/T=Regular expressions:/C=1/W=1/L=4');
  1362. {
  1363.         Set_Global_Str('CMISTR_3', Search_Switches );
  1364.         Set_Global_Str('CMIPARM_3', '/T=Switches [I,X]:/C=1/L=3/W=2' );
  1365. }
  1366.         RM( 'USERIN^Data_In /PRE=CM/H=CC/#=4/A=3/S=1/X=1/Y=3/T=DISPLAY LINES CONTAINING SEARCH STRING' );
  1367.         IF ((Return_Int = 0) and (Using_Search = False)) THEN
  1368. {If they pressed <ESC> and we are not already using search, then go back to
  1369. using cutoff column}
  1370.             Goto DO_CUTOFF;
  1371.         END;
  1372.         Search_String := Global_Str('CMISTR_1');
  1373.         Search_Switches := '';
  1374.         IF (Global_Int('CMIINT_3') = 0) THEN
  1375.             Search_Switches := Search_Switches + 'I';
  1376.         END;
  1377.         IF (Global_Int('CMIINT_4') = 0) THEN
  1378.             Search_Switches := Search_Switches + 'X';
  1379.         END;
  1380. {
  1381.         Search_Switches := Caps(Global_Str('CMISTR_3'));
  1382. }
  1383.         Ignore_Case := (XPos('I',Search_Switches,1) > 0);
  1384.         Reg_Exp_Stat := (XPos('X',Search_Switches,1) = 0);
  1385.         Temp_Search := Search_String;
  1386. DO_SEARCH:
  1387.         Repaint := True;
  1388.         At_Top := False;
  1389.         At_Bottom := False;
  1390.         Using_Search := True;
  1391.         Set_Global_Int('Condense_Mode',True);
  1392.         Set_Global_Str('Condense_Search',Search_String);
  1393.         Set_Global_Str('Condense_Switches',Search_Switches);
  1394.         Kill_Box;
  1395.         Call GET_LINES;
  1396.         Repaint := False;
  1397.     End;
  1398.     Call GET_LINE_NUM;
  1399.     RET;
  1400.  
  1401. GET_LINE_NUM:
  1402.     IF (Val(New_Line_Num,Get_Line)) THEN
  1403.         New_Line_Num := 0;
  1404.     END;
  1405.     Put_Line_Num(New_Line_Num);
  1406.  
  1407.     Set_Global_Str('CONDENSEEV1','/T=Select line/KC=<ENTER>/W=18/K1=13/K2=28/R=13/Y=' +
  1408.             Str(Message_Row) + '/X=1');
  1409.     Set_Global_Str('CONDENSEEV2','/T=Cancel/KC=<ESC>/W=11/K1=27/K2=1/R=13/Y=' +
  1410.             Str(Message_Row) + '/X=20');
  1411.     IF (Using_Search) THEN
  1412.         Set_Global_Str('CONDENSEEV3','/T=Displaying by search string./KC=/W=28/K1=0/K2=61/R=61/Y=' +
  1413.                 Str(Message_Row) + '/X=32');
  1414.     ELSE
  1415.         Set_Global_Str('CONDENSEEV3','/T=Displaying by cutoff column./KC=/W=28/K1=0/K2=60/R=60/Y=' +
  1416.                 Str(Message_Row) + '/X=32');
  1417.     END;
  1418.  
  1419.     RM('USERIN^CHECKEVENTS /M=2/G=CONDENSEEV/#=3');
  1420.     switch_window( text_window );
  1421.     WHILE c_row > 1 DO
  1422.         up;
  1423.     END;
  1424.     goto_line( new_line_num );
  1425.     update_scroll_bar;
  1426.     switch_window( line_window );
  1427.     RET;
  1428.  
  1429. PROCESS_MOUSE:
  1430.     RET;
  1431.  
  1432. END_OF_MAC:
  1433.     Tab_Expand := Temp_Tab_Expand;
  1434.     Reg_Exp_Stat := Temp_Reg_Exp_Stat;
  1435.  
  1436.     Insert_Mode := Temp_Insert_Mode;
  1437.     Ignore_Case := Temp_Ignore_Case;
  1438.     Undo_Stat := True;
  1439.     Kill_Box;
  1440.     Refresh := True;
  1441.     Make_Message('');
  1442.     Pop_Labels;
  1443.     Messages := True;
  1444.     Redraw;
  1445.  
  1446. END_MACRO;
  1447.  
  1448. $MACRO SQUEEZE TRANS;
  1449. {******************************************************************************
  1450.                                                                 MULTI-EDIT MACRO
  1451.  
  1452. Name:  SQUEEZE
  1453.  
  1454. Description:  Converts all leading space characters to the appropriate # of
  1455.                             tab characters.
  1456.  
  1457.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1458. ******************************************************************************}
  1459.  
  1460.     def_int( jx );
  1461.     def_str( tstr );
  1462.  
  1463.     tof;
  1464.     refresh := false;
  1465.     undo_stat := false;  {no undo, to improve speed}
  1466.     while NOT( At_EOF ) Do
  1467.         first_word;
  1468.         jx := c_col;
  1469.         tstr := Get_Word('');
  1470.         Put_Line('');
  1471.         goto_col( jx );
  1472.         Text( tstr );
  1473.         down;
  1474.         Put_Line_Num( c_line );
  1475.     end;
  1476.     refresh := true;
  1477.     tof;
  1478.     undo_stat := true;
  1479. END_MACRO;