home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s4.arc / SETPARMC.MOD < prev    next >
Text File  |  1988-02-06  |  25KB  |  614 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                Set_Params --- Set Communications Parameters          *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. FUNCTION Set_Params( First_Time : BOOLEAN;
  6.                      Use_Script : BOOLEAN ) : BOOLEAN;
  7.  
  8. (*----------------------------------------------------------------------*)
  9. (*                                                                      *)
  10. (*     Function:  Set_Params                                            *)
  11. (*                                                                      *)
  12. (*     Purpose:    Set communications parameters                        *)
  13. (*                                                                      *)
  14. (*     Calling Sequence:                                                *)
  15. (*                                                                      *)
  16. (*        Flag := Set_Params( First_Time : BOOLEAN;                     *)
  17. (*                            Use_Script : BOOLEAN ) : BOOLEAN;         *)
  18. (*                                                                      *)
  19. (*           First_Time:  TRUE for initial setup, else FALSE.           *)
  20. (*           Use_Script:  TRUE to use commands from script buffer       *)
  21. (*                                                                      *)
  22. (*           Flag is TRUE if successful set-up, else FALSE.             *)
  23. (*                                                                      *)
  24. (*     Calls:    Async_Init                                             *)
  25. (*               Async_Open                                             *)
  26. (*               Get_Params                                             *)
  27. (*                                                                      *)
  28. (*----------------------------------------------------------------------*)
  29.  
  30. VAR
  31.    Reset_Attr    : BOOLEAN;
  32.    S             : STRING[10];
  33.    Vid_Mode      : INTEGER;
  34.    Save_Maxl     : INTEGER;
  35.    Save_MaxC     : INTEGER;
  36.    Regs          : Registers;
  37.    EGA_Rows      : INTEGER;
  38.    Save_Rev_Len  : INTEGER;
  39.    Save_Do_Status: BOOLEAN;
  40.    I             : INTEGER;
  41.  
  42. (*--------------------------------------------------------------------------*)
  43. (*      Read_Config_From_Script --- Read parameters from script buffer      *)
  44. (*--------------------------------------------------------------------------*)
  45.  
  46. PROCEDURE Read_Config_From_Script;
  47.  
  48. (*----------------------------------------------------------------------*)
  49. (*                                                                      *)
  50. (*     Function:   Read_Config_From_Script                              *)
  51. (*                                                                      *)
  52. (*     Purpose:    Reads parameters from PibTerm script buffer          *)
  53. (*                                                                      *)
  54. (*     Calling Sequence:                                                *)
  55. (*                                                                      *)
  56. (*        Read_Config_From_Script;                                      *)
  57. (*                                                                      *)
  58. (*     Calls:   Get_Config_File_Line_From_Script                        *)
  59. (*                                                                      *)
  60. (*----------------------------------------------------------------------*)
  61.  
  62. VAR
  63.    Ival       : INTEGER;
  64.    OK_To_Read : BOOLEAN;
  65.    I          : INTEGER;
  66.    J          : INTEGER;
  67.    Param_Num  : INTEGER;
  68.    Param_Str  : AnyStr;
  69.    Param_Ival : INTEGER;
  70.    Param_Rval : LONGINT;
  71.    Setting_Val: BOOLEAN;
  72.  
  73. (*----------------------------------------------------------------------*)
  74. (*   Copy_Script_String --- Copy a string from the script buffer        *)
  75. (*----------------------------------------------------------------------*)
  76.  
  77. PROCEDURE Copy_Script_String( VAR S: AnyStr; VAR V: INTEGER );
  78.  
  79. (*----------------------------------------------------------------------*)
  80. (*                                                                      *)
  81. (*     Remarks:                                                         *)
  82. (*                                                                      *)
  83. (*        Each string is stored in the form:                            *)
  84. (*                                                                      *)
  85. (*           String_Type    1 byte                                      *)
  86. (*           String_Length  1 byte                                      *)
  87. (*           Text           String_Length bytes                         *)
  88. (*                                                                      *)
  89. (*       The values for String_Type are:                                *)
  90. (*                                                                      *)
  91. (*           0  --- ordinary string, text follows                       *)
  92. (*           1  --- use 'localreply' text                               *)
  93. (*           2  --- use 'remotereply' text                              *)
  94. (*           3  --- use 'set' variable -- String_length is index        *)
  95. (*                                                                      *)
  96. (*       String_Length and Text are stored when String_Type = 0.        *)
  97. (*       Neither is stored for types 1 and 2.  String_Length =          *)
  98. (*       variable index is stored for type 3.                           *)
  99. (*                                                                      *)
  100. (*----------------------------------------------------------------------*)
  101.  
  102. VAR
  103.    L: INTEGER;
  104.  
  105. BEGIN (* Copy_Script_String *)
  106.                                    (* Pick up string type *)
  107.  
  108.    Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  109.    V                 := Script_Buffer^[Script_Buffer_Pos];
  110.  
  111.                                    (* Get string value based upon type *)
  112.    CASE V OF
  113.  
  114.       0:  BEGIN (* Text string *)
  115.  
  116.              Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  117.  
  118.              L := Script_Buffer^[Script_Buffer_Pos];
  119.  
  120.              MOVE( Script_Buffer^[Script_Buffer_Pos + 1], S[1], L );
  121.  
  122.              S[0] := CHR( L );
  123.  
  124.              Script_Buffer_Pos := Script_Buffer_Pos + L;
  125.  
  126.           END;
  127.  
  128.       1:  BEGIN (* Local reply string *)
  129.              S := Script_Reply;
  130.           END;
  131.  
  132.       2:  BEGIN (* Remote reply string *)
  133.              S := Script_Remote_Reply;
  134.           END;
  135.  
  136.       3:  BEGIN (* Script variable *)
  137.              Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  138.              V                 := Script_Buffer^[Script_Buffer_Pos];
  139.              S                 := Script_Variables^[V].Var_Value^;
  140.           END   (* Script variable *);
  141.  
  142.       ELSE
  143.           S := '';
  144.           V := 4;
  145.  
  146.    END (* CASE *);
  147.  
  148. END   (* Copy_Script_String *);
  149.  
  150. (*--------------------------------------------------------------------------*)
  151. (* Get_Config_File_Line_From_Script --- Get one param. line from script     *)
  152. (*--------------------------------------------------------------------------*)
  153.  
  154. FUNCTION Get_Config_File_Line_From_Script(  VAR Param_Num   : INTEGER;
  155.                                             VAR Param_Str   : AnyStr;
  156.                                             VAR Param_Ival  : INTEGER;
  157.                                             VAR Param_Rval  : LONGINT;
  158.                                             VAR Setting_Val : BOOLEAN
  159.                                           ) : BOOLEAN;
  160.  
  161. (*--------------------------------------------------------------------------*)
  162. (*                                                                          *)
  163. (*     Function:  Get_Config_File_Line_From_Script                          *)
  164. (*                                                                          *)
  165. (*     Purpose:   Reads and interprets one line of script buffer            *)
  166. (*                                                                          *)
  167. (*     Calling Sequence:                                                    *)
  168. (*                                                                          *)
  169. (*        QGot := Get_Config_File_Line_From_Script( VAR Param_Num: INTEGER; *)
  170. (*                                                  VAR Param_Str:  AnyStr; *)
  171. (*                                                  VAR Param_Ival: INTEGER;*)
  172. (*                                                  VAR Param_Rval: LONGINT;*)
  173. (*                                                  VAR Setting_Val:BOOLEAN *)
  174. (*                                                ) : BOOLEAN;              *)
  175. (*                                                                          *)
  176. (*           Param_Num   --- parameter number of this line                  *)
  177. (*           Param_Str   --- string value of parameter                      *)
  178. (*           Param_Ival  --- Integer value of parameter                     *)
  179. (*           Param_Rval  --- Real value of parameter                        *)
  180. (*           Setting_Val --- TRUE to set parameter value, FALSE if          *)
  181. (*                           retrieving it here.                            *)
  182. (*                                                                          *)
  183. (*           Qgot        --- TRUE if configuration line returned;           *)
  184. (*                           FALSE if end-of-buffer encountered on          *)
  185. (*                           script buffer.                                 *)
  186. (*                                                                          *)
  187. (*     Calls:  None                                                         *)
  188. (*                                                                          *)
  189. (*--------------------------------------------------------------------------*)
  190.  
  191. VAR
  192.    I      : INTEGER;
  193.    J      : INTEGER;
  194.    L      : INTEGER;
  195.    PName  : Char_2;
  196.    NumDone: BOOLEAN;
  197.    S1     : AnyStr;
  198.    Command: Pibterm_Command_Type;
  199.  
  200. BEGIN (* Get_Config_File_Line_From_Script *)
  201.  
  202.                                    (* Initialize parameter values *)
  203.    Param_Num   := 0;
  204.    Param_Str   := '';
  205.    Param_Ival  := 0;
  206.    Param_Rval  := 0;
  207.    Setting_Val := FALSE;
  208.                                    (* Move to next slot in script *)
  209.  
  210.    Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  211.  
  212.                                    (* See if it's ParamSy or SetParamSy *)
  213.  
  214.    I       := Script_Buffer^[Script_Buffer_Pos];
  215.    Command := PibTerm_Command_Table_2[ I ];
  216.  
  217.    IF ( ( Command = ParamSy    ) OR
  218.         ( Command = GetParamSy ) OR
  219.         ( Command = SetParamSy ) )   THEN
  220.       BEGIN
  221.  
  222.          Get_Config_File_Line_From_Script := TRUE;
  223.  
  224.          CASE Command OF
  225.  
  226.             ParamSy :    BEGIN
  227.  
  228.                             Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  229.  
  230.                             J                 := Script_Buffer_Pos;
  231.                             PName[1]          := UpCase( CHR( Script_Buffer^[J]   ) );
  232.                             PName[2]          := UpCase( CHR( Script_Buffer^[J+1] ) );
  233.  
  234.                             L                 := Script_Buffer^[J+2];
  235.                             Script_Buffer_Pos := J + 2;
  236.  
  237.                             FOR J := 1 TO L DO
  238.                                BEGIN
  239.                                   Script_Buffer_Pos := SUCC( Script_Buffer_Pos );
  240.                                   Param_Str         := Param_Str +
  241.                                                        CHR( Script_Buffer^[Script_Buffer_Pos] );
  242.                                END;
  243.  
  244.                             S1 := 'Set parameter ' + PName +
  245.                                   ' to ' + Param_Str;
  246.  
  247.                             Write_Log( S1 , TRUE , FALSE );
  248.  
  249.                          END;
  250.  
  251.             GetParamSy,
  252.             SetParamSy : BEGIN
  253.                             Copy_Script_String( S1 , J );
  254.                             PName := '  ';
  255.                             FOR J := 1 TO MIN( LENGTH( S1 ) , 2 ) DO
  256.                                PName[J] := UpCase( S1[J] );
  257.                             Copy_Script_String( Param_Str , J );
  258.                          END;
  259.  
  260.          END (* CASE *);
  261.                                    (* Search for parameter *)
  262.  
  263.          Param_Num := Look_Up_Parameter( PName );
  264.  
  265.                                    (* If found, convert to numeric if *)
  266.                                    (* appropriate                     *)
  267.  
  268.          IF ( Param_Num > 0 ) THEN
  269.             IF Command = GetParamSy THEN
  270.                BEGIN
  271.  
  272.                   Get_Parameter( Param_Num , Param_Str );
  273.  
  274.                   Script_Variables^[J].Var_Value^ := Param_Str;
  275. {
  276.                   IF Debug_Mode THEN
  277.                      WRITELN('Get_Params: PName = ' + S1 + ', # = ' +
  278.                                IToS( Param_Num ) + ' = <' +
  279.                                Param_Str + '>; Var = ' +
  280.                                IToS( J ) );
  281. }
  282.                END
  283.             ELSE
  284.                BEGIN
  285.  
  286.                   Setting_Val := TRUE;
  287.  
  288.                   L       := LENGTH( Param_Str );
  289.                   NumDone := ( L = 0 );
  290.                   I       := 0;
  291.  
  292.                   WHILE ( NOT NumDone ) DO
  293.                      BEGIN
  294.                         I := SUCC( I );
  295.                         IF Param_Str[I] IN ['0'..'9'] THEN
  296.                            Param_Ival := Param_Ival * 10 +
  297.                                          ORD( Param_Str[I] ) - ORD( '0' );
  298.                         NumDone := NumDone OR ( I >= L ) OR
  299.                                    ( Param_Str[I] = ' ');
  300.                      END;
  301.  
  302.                   IF ( L > 0 ) THEN
  303.                      IF ( UpCase( Param_Str[1] ) = 'Y' ) THEN
  304.                         Param_Ival := 1;
  305.  
  306.                   Param_Rval := Param_Ival;
  307.  
  308.                END
  309.  
  310.          ELSE
  311.             IF ( Command = GetParamSy ) THEN
  312.                Script_Variables^[J].Var_Value^ := '';
  313.  
  314.       END
  315.  
  316.    ELSE
  317.       BEGIN
  318.          Get_Config_File_Line_From_Script := FALSE;
  319.          Script_Buffer_Pos                := PRED( Script_Buffer_Pos );
  320.       END;
  321.  
  322. END   (* Get_Config_File_Line_From_Script *);
  323.  
  324. (*--------------------------------------------------------------------------*)
  325.  
  326. BEGIN (* Read_Config_From_Script *)
  327.  
  328.                                    (* Point to 'Paramsy' entry *)
  329.  
  330.    Script_Buffer_Pos := PRED( Script_Buffer_Pos );
  331.  
  332.                                    (* Pick up all get/set parameter entries *)
  333.  
  334.    WHILE( Get_Config_File_Line_From_Script( Param_Num, Param_Str, Param_Ival,
  335.                                             Param_Rval, Setting_Val ) ) DO
  336.       IF Setting_Val THEN
  337.          Set_Parameter( Param_Num, Param_Ival, Param_Rval, Param_Str );
  338.  
  339. END   (* Read_Config_From_Script *);
  340.  
  341. (*----------------------------------------------------------------------*)
  342. (*                    Set_Params --- Main code body                     *)
  343. (*----------------------------------------------------------------------*)
  344.  
  345. BEGIN (* Set_Params *)
  346.                                    (* Don't reset port unless needed *)
  347.    Reset_Comm_Port        := FALSE;
  348.  
  349.                                    (* If comm port changes *)
  350.    Comm_Port_Changed      := FALSE;
  351.  
  352.                                    (* If keyboard interrupt changes *)
  353.    Kbd_Interrupt_Change   := FALSE;
  354.  
  355.                                    (* If video interrupt changes    *)
  356.    Video_Interrupt_Change := FALSE;
  357.  
  358.                                    (* Remember current colors *)
  359.  
  360.    New_ForeGround_Color  := ForeGround_Color;
  361.    New_BackGround_Color  := BackGround_Color;
  362.    New_Menu_Text_Color   := Menu_Text_Color;
  363.    New_Menu_Title_Color  := Menu_Title_Color;
  364.    New_Menu_Text_Color_2 := Menu_Text_Color_2;
  365.    New_Menu_Frame_Color  := Menu_Frame_Color;
  366.    New_Border_Color      := Border_Color;
  367.  
  368.                                    (* Remember current screen size *)
  369.  
  370.    New_Max_Screen_Line   := Max_Screen_Line;
  371.    New_Max_Screen_Col    := Max_Screen_Col;
  372.    Save_Maxl             := Max_Screen_Line;
  373.    Save_MaxC             := Max_Screen_Col;
  374.  
  375.                                    (* Remember current text mode *)
  376.    New_Text_Mode         := Text_Mode;
  377.  
  378.                                    (* Remember current terminal  *)
  379.  
  380.    IF ( Terminal_To_Emulate <> Gossip ) THEN
  381.       Saved_Gossip_Term := Terminal_To_Emulate;
  382.  
  383.                                    (* Remember review buffer length *)
  384.  
  385.    Save_Rev_Len := Max_Review_Length;
  386.  
  387.                                    (* Get parameter values      *)
  388.    IF( NOT First_Time ) THEN
  389.       IF ( NOT Use_Script ) THEN
  390.          Get_Default_Params( FALSE )
  391.       ELSE
  392.          Read_Config_From_Script;
  393.  
  394.                                    (* Initialize Comm Variables *)
  395.  
  396.    IF ( First_Time OR Comm_Port_Changed OR ( Cmd_Line_Port > 0 ) ) THEN
  397.       BEGIN
  398.                                    (* Set up com port hardware addresses *)
  399.  
  400.          FOR I := 1 TO MaxComPorts DO
  401.             Async_Setup_Port( I,
  402.                               Default_Com_Base[I],
  403.                               Default_Com_Irq [I],
  404.                               Default_Com_Int [I] );
  405.  
  406.                                    (* Set up buffers *)
  407.  
  408.          Async_Init( Async_Buffer_Length, Async_OBuffer_Length, 0, 0, 0 );
  409.  
  410.                                    (* If a command line port override *)
  411.                                    (* exists, use it.                 *)
  412.  
  413.          IF ( Cmd_Line_Port > 0 ) THEN
  414.             BEGIN
  415.                Comm_Port     := Cmd_Line_Port;
  416.                Cmd_Line_Port := 0;
  417.             END;
  418.                                    (* Check if space found for buffers *)
  419.  
  420.          IF ( ( Async_Buffer_Ptr = NIL ) OR ( Async_OBuffer_Ptr = NIL ) ) THEN
  421.             Set_Params := FALSE
  422.  
  423.                                    (* Open Communications Port  *)
  424.          ELSE
  425.             Set_Params := Async_Open( Comm_Port, Baud_Rate, Parity, Data_Bits,
  426.                                       Stop_Bits );
  427.  
  428.       END
  429.    ELSE
  430.       BEGIN
  431.                                    (* Not 1st time, same port -- *)
  432.                                    (* reset open port            *)
  433.          Set_Params := TRUE;
  434.  
  435.          IF Reset_Comm_Port THEN
  436.             Async_Reset_Port( Comm_Port, Baud_Rate, Parity, Data_Bits,
  437.                               Stop_Bits );
  438.  
  439.       END;
  440.                                    (* Change text mode, colors      *)
  441.  
  442.    IF Text_Mode <> New_Text_Mode THEN
  443.       BEGIN
  444.          Text_Mode := New_Text_Mode;
  445.          TextMode( Text_Mode );
  446.       END;
  447.                                    (* Reset CTS check on/off        *)
  448.    Async_Do_CTS := Check_CTS;
  449.                                    (* Reset DSR check on/off        *)
  450.    Async_Do_DSR := Check_DSR;
  451.                                    (* Reset XON/XOFF check on/off   *)
  452.  
  453.    Async_Do_XonXoff := Do_Xon_Xoff_Checks;
  454.    Async_OV_XonXoff := Do_Xon_XOff_Checks;
  455.  
  456.                                    (* Reset hard-wired status       *)
  457.  
  458.    Async_Hard_Wired_On := Hard_Wired;
  459.  
  460.                                    (* Reset break length            *)
  461.  
  462.    Async_Break_Length := Break_Length;
  463.  
  464.                                    (* Reset colors                  *)
  465.  
  466.    Reset_Attr        := ( ForeGround_Color <> New_ForeGround_Color ) OR
  467.                         ( BackGround_Color <> New_BackGround_Color ) OR
  468.                         ( Save_Maxl        <> Max_Screen_Line      ) OR
  469.                         ( Save_MaxC        <> Max_Screen_Col       );
  470.  
  471.    ForeGround_Color  := New_ForeGround_Color;
  472.    BackGround_Color  := New_BackGround_Color;
  473.    Menu_Text_Color   := New_Menu_Text_Color;
  474.    Menu_Title_Color  := New_Menu_Title_Color;
  475.    Menu_Text_Color_2 := New_Menu_Text_Color_2;
  476.    Menu_Frame_Color  := New_Menu_Frame_Color;
  477.    Border_Color      := New_Border_Color;
  478.  
  479.    Set_Global_Colors( ForeGround_Color , BackGround_Color );
  480.  
  481.    Vid_Mode := Current_Video_Mode;
  482.    IF ( Vid_Mode < MedRes_GraphMode ) OR ( Vid_Mode = Mono_TextMode ) THEN
  483.       Set_Border_Color ( Border_Color );
  484.  
  485.                                    (* Update wait-for-retrace option *)
  486.  
  487.    Wait_For_Retrace := Wait_For_Retrace_Par AND
  488.                        ( NOT ( EGA_Present OR ( Vid_Mode = 7 ) ) );
  489.  
  490.                                    (* Set write to screen mode *)
  491.  
  492.    Write_Screen_Memory := Write_Screen_Memory_Par (* OR TimeSharingActive *);
  493.  
  494.                                    (* Ensure proper screen length *)
  495.  
  496.    Max_Screen_Line   := New_Max_Screen_Line;
  497.    Max_Screen_Col    := New_Max_Screen_Col;
  498.  
  499.    IF Do_Status_Line THEN
  500.       Last_Line_To_Set := PRED( Max_Screen_Line )
  501.    ELSE
  502.       Last_Line_To_Set := Max_Screen_Line;
  503.  
  504.    Save_Do_Status := Do_Status_Line;
  505.    Do_Status_Line := FALSE;
  506.                                    (* Reset screen size *)
  507.  
  508.    IF ( ( Max_Screen_Line <> Save_MaxL ) OR
  509.         ( Max_Screen_Col  <> Save_MaxC ) ) THEN
  510.       BEGIN
  511.          IF ( ATI_Ega_Wonder AND ( Max_Screen_Col <> Save_MaxC ) ) THEN
  512.             BEGIN
  513.                CASE Max_Screen_Col OF
  514.                   132: BEGIN
  515.                           Regs.AX := $23;
  516.                           INTR( $10, Regs );
  517.                        END;
  518.                   ELSE BEGIN
  519.                           Regs.AX := $03;
  520.                           INTR( $10, Regs );
  521.                        END;
  522.                END (* CASE *);
  523.             END (* BEGIN *);
  524.          PibTerm_Window( 1, 1, Max_Screen_Col, Max_Screen_Line );
  525.       END;
  526.                                    (* Reset if new # lines and EGA/VGA *)
  527.  
  528.    IF EGA_Present THEN
  529.       BEGIN
  530.                                    (* Get # of rows in current display *)
  531.          Regs.AH := $11;
  532.          Regs.AL := $30;
  533.          Regs.BH := 0;
  534.  
  535.          INTR( $10 , Regs );
  536.  
  537.          IF ( Max_Screen_Line <> SUCC( Regs.DL ) ) THEN
  538.             BEGIN
  539.                Set_EGA_Text_Mode( Max_Screen_Line );
  540.                Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 0,
  541.                        ForeGround_Color, BackGround_Color );
  542.                PibTerm_Window( 1, 1, Max_Screen_Col, Max_Screen_Line );
  543.             END;
  544.  
  545.       END;
  546.                                    (* Reset attributes *)
  547.    IF Reset_Attr THEN
  548.       Set_Text_Attributes( 1, 1, Max_Screen_Col, Last_Line_To_Set,
  549.                            ForeGround_Color, BackGround_Color );
  550.  
  551.                                    (* Make sure gossip mode set properly *)
  552.  
  553.    Gossip_Mode_On := ( Terminal_To_Emulate = Gossip );
  554.  
  555.                                    (* Fixup keyboard handler if needed   *)
  556.    IF Kbd_Interrupt_Change THEN
  557.       IF Extended_Keypad THEN
  558.          Install_Keyboard_Handler
  559.       ELSE
  560.          Remove_Keyboard_Handler;
  561.  
  562.                                    (* Update software_scrolling option *)
  563.  
  564.    Software_Scroll := Software_Scroll_Par AND {Wait_For_Retrace AND}
  565.                       Write_Screen_Memory AND ( NOT TimeSharingActive );
  566.  
  567.                                    (* Fixup video handler if needed      *)
  568.    IF Video_Interrupt_Change THEN
  569.       IF ( NOT Video_Handler_Installed ) THEN
  570.          Install_Video_Handler
  571.       ELSE
  572.          Remove_Video_Handler;
  573.  
  574.    Wrap_Screen_Col := Max_Screen_Col;
  575.  
  576.                                    (* Fix review buffer if needed *)
  577.  
  578.    IF ( Save_Rev_Len <> Max_Review_Length ) THEN
  579.       BEGIN
  580.  
  581.          IF ( Save_Rev_Len > 0 ) AND ( Review_Buffer <> NIL ) THEN
  582.             BEGIN
  583.                MyFreeMem( Review_Buffer , Save_Rev_Len );
  584.                Review_Buffer := NIL;
  585.             END;
  586.  
  587.          IF ( Max_Review_Length > ( MaxAvail - 8000 ) ) THEN
  588.             Max_Review_Length := MAX( 0 , ( MaxAvail - 8000 ) );
  589.  
  590.          Review_On := ( Max_Review_Length > 0 );
  591.  
  592.          IF Review_On THEN
  593.             GetMem( Review_Buffer , Max_Review_Length );
  594.  
  595.          Review_On        := Review_On AND ( Review_Buffer <> NIL );
  596.  
  597.          Review_Head      := 0;
  598.          Review_Tail      := 0;
  599.          Review_Line      := '';
  600.  
  601.      END;
  602.                                    (* Restore status line display *)
  603.  
  604.    Do_Status_Line := Save_Do_Status;
  605.  
  606.                                    (* Open/close logging file *)
  607.    IF Logging_On THEN
  608.       IF ( NOT Log_File_Open ) THEN
  609.          Log_File_Open := Open_For_Append( Log_File,
  610.                                            Log_File_Name, I );
  611.  
  612. END   (* Set_Params *);
  613.  
  614.