Previous Topic Next topic Print topic


Create a New Data File

To create a fixed length sequential file:

  1. Click File > New
  2. Select Data File; then click OK.
  3. Navigate to the DataToolsDemo project folder.
  4. Type newfile.dat into the Filename field and 20 into the Maximum Length field; then click Create.

    Because a fixed-length sequential file does not have a file header, you are prompted to save the file header details you have just entered.

  5. Click Yes.

    The IDE saves the file header details in a profile file in the same directory as the data file. Having a profile saves you from having to enter the file header details the next time you open the data file. Profile files have the same prefix as the data file with a .pro extension. Therefore, the profile file for this new data file is newfile.pro.

    A Data File Editor window appears, displaying File Empty.

    Now you can add and delete a few records.

  6. Right-click in the Data File Editor window and select Insert Record After on the context menu.

    The cursor is positioned at the start of the file.

  7. Type abc.
  8. Right-click in the Data File Editor window; then click Repeat Record on the context menu.

    A second record containing abc is added to the file.

  9. Click on the first record to select the record and type x.

    An update warning is displayed because you are attempting to change the record.

  10. Click No on the update warning message box.
  11. Right-click in the Data File Editor window; then click Delete Record on the context menu; then and click Yes on the Delete warning message box.

    The new record is deleted from the file and the cursor is positioned on the next record.

  12. Click File > Save.
  13. Close the Data File Editor window.
Previous Topic Next topic Print topic