home *** CD-ROM | disk | FTP | other *** search
- Program TestTFDD;
- { THis program will test the unit in Listing 6.2. It will }
- { open the device, and then place information into it with a }
- { write and a writeln statement. }
- Uses
- Crt, TFDD; { Link in the necessary units }
-
- Type
- Str5 = String[5]; { Just to define a sub string type }
-
- Var
- RAM : Text; { Text file to be passed to TFDD }
- R : Real; { One of the values placed in buffer }
- I : Integer; { Another of the variables in buffer }
- Ch : Char; { Another type of variable }
- S : Str5; { Last of the different types }
-
- Begin
- AssignDev( Ram ); { Call the Initialization routine }
- Rewrite( Ram ); { Open the file for output }
- R := 999.324; { One value to be written }
- I := -123; { ANother value for the buffer }
- Ch := 'Y'; { A character value for the buffer }
- S := 'Test'; { A substring type for the buffer }
- Writeln( Ram, 'This is a ', S, ' of ', R:4:2, ' ', Ch, I );
- { Place all of these in buffer }
- Close( Ram ); { Close the device }
- Writeln( theBuffer ); { Send buffer to screen for viewing }
- Readln; { Pause for Screen Viewing }
- End.
-