The purpose of opening data file is called file mode.
- The different modes of opening sequential data files in qbasic are:
- OUTPUT or "O" mode:
- OUTPUT mode is used to create a new sequential data file. If the data file is already exists, it will erase all previous contents and new contents are added from the beginning of the file.
- Example of OUTPUT mode: (Click)
- APPEND or "A" mode:
- APPEND mode is used to add more records in the existing sequential data file. It will add data from the end of the file.
- Example of APPEND mode: (Click)
- INPUT or "I" mode:
- INPUT mode is used to open data file for reading data from existing file.
- Example of INPUT mode: (Click)