0 like 0 dislike
28 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 34 views
0 like 0 dislike
0 answers 25 views
0 like 0 dislike
1 answer 88 views
0 like 0 dislike
1 answer 108 views
0 like 0 dislike
1 answer 39 views
0 like 0 dislike
1 answer 68 views
asked Apr 1, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 48 views
0 like 0 dislike
1 answer 50 views
0 like 0 dislike
1 answer 50 views
0 like 0 dislike
1 answer 120 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

4.1k users

Free Hit Counters
...