0 like 0 dislike
37 views
in Computer Science by (1.0m points)
Briefly describe the opening modes in BASIC?

1 Answer

0 like 0 dislike
by (1.0m points)
Opening a File: When creating a sequential file,the first thing the programmer must do is open the file using the open statement.The open statement has the following form:OPEN"file Name.ext"FOR mode AS#[buffer].The OPEN statement will provide the name of the file,the way in which it will be used ,and the buffer number of the file.The same rule apply for the naming data files as they do for naming "regular"BASIC program files,except a data file should normally be given an extension ).ext) of .DAT where as a program file is given an extension of .BAS.

WRTITING TO A FILE:Writting to a file that has been previously opened in OUTPUT mode is accomplished using the write # statement works much like the print statement,except instead of sending output to the screen,the WRITE # statement will send data to the opend file .Another difference is that when using the WRITE# statement, you must first indicate the buffer number of the file being written to .For example,consider the following WRITE# statement:

WRITE#1,name,address,phone READING FROM a File: Reading data from a file that has been previously opened as INPUT is accomplished using the INPUT# statement.The INPUT # statement is similar to the INPUT statement,except instead of reading user data input from the keyboard,the INPUT# statement reads data input from a file on disk .For example,consider the following: INPUT#1,stuName,gpa,grade

Related questions

0 like 0 dislike
1 answer 41 views
0 like 0 dislike
0 answers 34 views
0 like 0 dislike
1 answer 108 views
0 like 0 dislike
1 answer 115 views
0 like 0 dislike
1 answer 51 views
0 like 0 dislike
1 answer 76 views
asked Apr 1, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 57 views
0 like 0 dislike
1 answer 59 views
0 like 0 dislike
1 answer 60 views
0 like 0 dislike
1 answer 134 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

6.3k users

Free Hit Counters
...