home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / pibsoft / terminal / source / alocdirv.mod < prev    next >
Encoding:
Text File  |  1987-12-26  |  1.2 KB  |  35 lines

  1. (*----------------------------------------------------------------------*)
  2. (*  Allocate_Dial_And_Review --- Get memory for dial dir and review buf *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Allocate_Dial_And_Review;
  6.  
  7. BEGIN (* Allocate_Dial_And_Review *)
  8.  
  9.                                    (* Allocate dialing directory *)
  10.  
  11.    GetMem( Dialing_Directory , Dialing_Dir_Size_Max *
  12.                                Dialing_Dir_Entry_Length );
  13.  
  14.                                    (* Check if we got the space *)
  15.  
  16.    IF ( Dialing_Directory = NIL ) THEN
  17.       WRITELN('--- There is not enough memory to store the dialing directory.');
  18.  
  19.                                    (* Get review buffer *)
  20.  
  21.    IF ( Max_Review_Length > ( MaxAvail - 8000 ) ) THEN
  22.       Max_Review_Length    := MAX( 0 , ( MaxAvail - 8000 ) );
  23.  
  24.    Review_On := ( Max_Review_Length > 0 );
  25.  
  26.    IF Review_On THEN
  27.       GetMem( Review_Buffer , Max_Review_Length );
  28.  
  29.    Review_On := Review_On AND ( Review_Buffer <> NIL );
  30.  
  31.    Review_Head      := 0;
  32.    Review_Tail      := 0;
  33.    Review_Line[0]   := #0;
  34.  
  35. END    (* Allocate_Dial_And_Review *);