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

  1. Program CreateData;
  2. { This program will create the data file used in the example  }
  3. { program in listing 8.13.  It simply creates a binary file   }
  4. { of type word, and then places the values 1 to 100 into      }
  5. { that new data file.                                         }
  6.  
  7. Var
  8.   F : File of Word;      { Output File Type - Word            }
  9.   W : Word;              { Variable type for the output file  }
  10.  
  11. Begin
  12.   Assign( F, 'DATA.DAT' );{ Associate the file name with F    }
  13.   Rewrite( F );          { Open the file for Output Only      }
  14.   For W := 1 to 100 Do   { Loop 100 times for file output     }
  15.     Write( F, W );       { Write the info to the file         }
  16.   Close( F );            { Update the file properly           }
  17. End.
  18.