file

 BBS: Inland Empire Archive
Date: 05-07-92 (11:26)             Number: 32
From: RICHARD VANNOY               Refer#: NONE
  To: JULIO TARAFA                  Recvd: NO  
Subj: file                           Conf: (2) Quik_Bas
JT> can anyone tell me how to very simply open a text file and write
JT>something to the end of it in basic (just adding one line at a time, and
JT>then closing it, sort of like a bbs lister you can view it then add one
JT>if you wish.. can someone help?)

   CLS
   OPEN "FILENAME.TXT" FOR INPUT AS #1
   DO
      LINE INPUT #1, lin$
      PRINT lin$
   LOOP WHILE NOT EOF(1)
   CLOSE #1

   OPEN "FILENAME.TXT" FOR APPEND AS #1

   'or on a network
   'OPEN "FILENAME.TXT" FOR APPEND ACCESS WRITE AS #1

   DO
      INPUT "Line to add or RETURN to QUIT): ",lin$
      IF LEN(lin$) THEN PRINT #1, lin$
   LOOP WHILE LEN(lin$)
   CLOSE #1
END

> MegaMail 2.1b #0:640K = 4480K in Dog Bytes


--- WM v2.01/91-0012
 * Origin: Com-Dat BBS  Hillsboro, OR.  HST (503) 681-0543 (1:105/314)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET