Site hosted by Angelfire.com: Build your free website today!
NAME
  WRITE Statement

SYNOPSIS
  WRITE [[#]filenumber%,] expressionlist
      o filenumber%       The number of an open sequential file. If the file
                          number is omitted, WRITE writes to the screen.
      o expressionlist    One or more variables or expressions, separated by
                          commas, whose values are written to the screen or
                          file.
      o WRITE inserts commas between items and quotation marks around strings
        as they are written. WRITE writes values to a file in a form that can
        be read by the INPUT statement.

DESCRIPTION
  Writes data to the screen or a sequential file.

  Example:
      CLS
      OPEN "LIST" FOR OUTPUT AS #1
      DO
          INPUT "   NAME:       ", Name$
          INPUT "   AGE:        ", Age$
          WRITE #1, Name$, Age$
          INPUT "Add another entry"; R$
      LOOP WHILE UCASE$(R$) = "Y"
      CLOSE #1
      'Print the file to the screen.
      OPEN "LIST" FOR INPUT AS #1
      CLS
      PRINT "Entries in file:": PRINT
      DO WHILE NOT EOF(1)
          INPUT #1, Rec1$, Rec2$   'Read entries from file.
          PRINT Rec1$, Rec2$       'Print the entries on the screen.
      LOOP
      CLOSE #1
      KILL "LIST"

SEE ALSO
  INPUT LINE INPUT OPEN PRINT LPRINT