Computer Science, asked by aayusha52, 1 year ago

Write the syntax to open a file on QBasic.









ANSWER FAST..........​

Answers

Answered by vishwasslacek
7

Answer:

QBasic

In this lesson, we will learn how to create and modify files. In doing so, we will create a portion of a text editor to handle reading and writing files to and from disk - the program won't be complete by the end of this chapter, but will be finished within Advanced Text Output.

Let's start by setting up out main procedure:

'$DYNAMIC

ON ERROR GOTO handler ' Prepares the error handler

DIM text(50) AS STRING ' Used to contain the text file.

maxlines = 50 ' Contains the current size of the buffer.

DO

CLS 'clears the screen

INPUT "Would you like to create a (N)ew file, (L)oad an existing one, or (E)xit the program"; choice$

SELECT CASE UCASE$(choice$) 'UCASE$ converts strings to UPPER CASE

CASE "N" 'New file

CASE "L" 'Load a file

CASE "E" 'Exit

CLS

END

END SELECT

LOOP 'returns to the top of the program.

handler:

errorflag = ERR ' Keep track of the error that occurred.

RESUME NEXT ' Proceeds with the next statement.

As you can see, we are using CASE rather than IF. IF statements can sometimes work better than case statements, but for now, we want to avoid spaghetti code (where there are too many GOTO's).

So far, we don't really have much, but it's a start. We've asked the user what they want to do, and finished 1/3 options. Not so shabby when you put it that way!

Answered by Aayushatewary5
3

Answer:

Ask to Google...

Explanation:

Please mark me as a BRAINLIST.....

plz plz plz plz plz plz plz plz plz plz plz plz

Similar questions