home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
bbs
/
pibterm
/
pibt3sp1
/
getcaptu.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-24
|
5KB
|
131 lines
(*----------------------------------------------------------------------*)
(* Get_Capture_File -- Get session capture file name *)
(*----------------------------------------------------------------------*)
OVERLAY PROCEDURE Get_Capture_File( Capture_FName : AnyStr );
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Get_Capture_File *)
(* *)
(* Purpose: Opens capture file *)
(* *)
(* Calling Sequence: *)
(* *)
(* Get_Capture_File( Capture_FName : AnyStr ); *)
(* *)
(* Capture_FName --- name of capture file; prompted for *)
(* if null. *)
(* *)
(*----------------------------------------------------------------------*)
VAR
OK_File : BOOLEAN;
File_Exists : BOOLEAN;
Name_Given : BOOLEAN;
BEGIN (* Get_Capture_File *)
Save_Screen( Saved_Screen );
Draw_Menu_Frame( 10, 10, 70, 15, Menu_Frame_Color,
Menu_Text_Color, 'Capture session' );
(* If capture mode ON, close current *)
(* capture file and turn capture mode *)
(* OFF. *)
IF Capture_On THEN
BEGIN
(*$I-*)
CLOSE( Capture_File );
(*$I+*)
Capture_On := FALSE;
WRITELN;
WRITELN('*** Capturing of session terminated.');
DELAY( Two_Second_Delay );
END
ELSE (* If capture mode OFF, then get name *)
(* of file to capture to, and turn on *)
(* capture mode. *)
BEGIN (* Capture mode was Off *)
Capture_File_Name := Capture_FName;
OK_File := FALSE;
Name_Given := LENGTH( Capture_File_Name ) > 0;
REPEAT
GoToXY( 1 , 1 );
ClrEol;
WRITE('File name to capture session to ? ');
IF ( NOT Name_Given ) THEN
READLN( Capture_File_Name )
ELSE
WRITELN( Capture_File_Name );
DELAY ( One_Second_Delay );
ASSIGN( Capture_File , Capture_File_Name );
(*$I-*)
RESET( Capture_File );
(*$I+*)
IF Int24Result = 0 THEN
BEGIN
IF ( NOT Name_Given ) THEN
OK_File := YesNo('File ' + Capture_File_Name +
' already exists, append to it (Y/N) ? ')
ELSE
OK_File := TRUE;
File_Exists := TRUE;
(*$I-*)
CLOSE( Capture_File );
(*$I+*)
END
ELSE
BEGIN
OK_File := TRUE;
File_Exists := FALSE;
END;
UNTIL ( OK_File ) OR ( LENGTH( Capture_File_Name ) = 0 );
IF LENGTH( Capture_File_Name ) > 0 THEN
BEGIN
ASSIGN ( Capture_File, Capture_File_Name );
(*$I-*)
IF File_Exists THEN
APPEND ( Capture_File )
ELSE
REWRITE( Capture_File );
(*$I+*)
IF Int24Result <> 0 THEN
BEGIN
WRITELN('Can''t open ',Capture_File_Name,' for output.');
WRITELN('Capture will not be done.');
END
ELSE
BEGIN
WRITELN('Capturing session to file ',Capture_File_Name );
Capture_On := TRUE;
END;
DELAY ( One_Second_Delay );
END (* Length( Capture_File_Name ) > 0 *);
END (* Capture mode was OFF *);
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
END (* Get_Capture_File *);
ə