Published by: BhumiRaj Timalsina
Published date: 10 Jan 2022
Data are used in all the programs for retrieving information. In QBASIC you can store data in a separate file called a data file. Hence there are two types of files in data processing. They are:Open file, process file.
Some useful commands with their function and syntax are given below:
Files: This command is used to display all the files of current drive. Syntax: Files [File specification]
Shell: This command is used to go to DOS prompt temporarily.
NAME: This command is used to change the old file into new file. Syntax: Name " old file name" AS "New file name"
Kill: This command is used to remove the file from the disk. Syntax: Kill [ File Specification ]
MKDIR: This command is used to create a directory in a specific disk Syntax: MKDIR "path"
CHDIR: This command is used to change the directory. Syntax: CHDIR " path"
RMDIR: This command is used to remove the specific directory. Syntax: RMDIR "path"
System: This command is used to close the Q-BASIC program.
OPEN: This statement is used to open the file.
WRITE#: This statement is used to place the data into data file.
NPUT#: This statement is used to read each data and stores to corresponding variable.
LINE INPUT#: This statement reads entire line having maximum 255 characters and stores to a single string variable.
EOF ( ) : This statement is used to end a file. Syntax: EOF ( File number)
You need to open a sequential access data file in order to use it. A sequential data file can be opened in one of three modes.
Types of Mode: