home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST0603.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-31  |  1.4 KB  |  32 lines

  1. Program TestTFDD;
  2. { THis program will test the unit in Listing 6.2.  It will    }
  3. { open the device, and then place information into it with  a }
  4. { write and a writeln statement.                              }
  5. Uses
  6.   Crt, TFDD;             { Link in the necessary units        }
  7.  
  8. Type
  9.   Str5 = String[5];      { Just to define a sub string type   }
  10.  
  11. Var
  12.   RAM : Text;            { Text file to be passed to TFDD     }
  13.   R : Real;              { One of the values placed in buffer }
  14.   I : Integer;           { Another of the variables in buffer }
  15.   Ch : Char;             { Another type of variable           }
  16.   S : Str5;              { Last of the different types        }
  17.  
  18. Begin
  19.   AssignDev( Ram );      { Call the Initialization routine    }
  20.   Rewrite( Ram );        { Open the file for output           }
  21.   R := 999.324;          { One value to be written            }
  22.   I := -123;             { ANother value for the buffer       }
  23.   Ch := 'Y';             { A character value for the buffer   }
  24.   S := 'Test';           { A substring type for the buffer    }
  25.   Writeln( Ram, 'This is a ', S, ' of ', R:4:2, ' ', Ch, I );
  26.                          { Place all of these in buffer       }
  27.   Close( Ram );          { Close the device                   }
  28.   Writeln( theBuffer );  { Send buffer to screen for viewing  }
  29.   Readln;                { Pause for Screen Viewing           }
  30. End.
  31.  
  32.