To create a fixed length sequential file:
- Click
File > New
- Select
Data File; then click
OK.
- Navigate to the
DataToolsDemo project folder.
- 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.
- 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.
- 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.
- Type
abc.
- 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.
- 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.
- Click
No on the update warning message box.
- 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.
- Click
File > Save.
- Close the Data File Editor window.