qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LINE INPUT Statement Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
LINE INPUT Statement Programming Example
 
The following program enables the user to enter text in a notes file.
The LINE INPUT statement allows you to enter any characters, including
those (such as a comma) that are delimiters in a regular INPUT statement.
 
'Opens and writes lines to a notes file until you
'enter a blank line.
DO
    CLS
    PRINT "Enter text. To stop, press <RETURN> without ";
    PRINT "entering any new text." : PRINT
    OPEN "NOTES.TXT" FOR OUTPUT AS #1
 
    ' Take lines until a blank line is entered.
    DO
        LINE INPUT "->";Inline$
        IF Inline$ <> "" THEN PRINT #1, Inline$
    LOOP WHILE Inline$ <> ""
    CLS : CLOSE #1
 
' Echo the notes back and see if they are correct.
    OPEN "NOTES.TXT" FOR INPUT AS #1
    PRINT "You entered: " : PRINT
    DO WHILE NOT EOF(1)
        LINE INPUT #1, Inline$
        PRINT Inline$
    LOOP
    CLOSE #1
    PRINT : INPUT "Is this correct (Y/N)"; R$
 
LOOP WHILE UCASE$(R$)="N"
END