Site hosted by Angelfire.com: Build your free website today!
NAME
  GET, PUT Statements (File I/O)

SYNOPSIS
  GET [#]filenumber%[,[recordnumber&][,variable]]
  PUT [#]filenumber%[,[recordnumber&][,variable]]
      o filenumber%      The number of an open file.
      o recordnumber&    For random-access files, the number of the record to
                         read or write. For binary-mode files, the byte
                         position where reading or writing starts.
      o variable         For GET, a variable used to receive input from the
                         file. For PUT, a variable that contains output to
                         write to the file. The variable is usually a variable
                         of a user-defined data type.

DESCRIPTION
  GET reads from a file into a random-access buffer or variable.
  PUT writes a variable or random-access buffer to a file.

  Example:
      TYPE TestRecord
          Student AS STRING * 20
          Score AS SINGLE
      END TYPE
      DIM MyClass AS TestRecord
      OPEN "FINAL.DAT" FOR RANDOM AS #1 LEN = LEN(MyClass)
      MyClass.Student = "MarySa"
      MyClass.Score = 99
      PUT #1, 1, MyClass
      CLOSE #1
      OPEN "FINAL.DAT" FOR RANDOM AS #1 LEN = LEN(MyClass)
      GET #1, 1, MyClass
      PRINT "STUDENT:", MyClass.Student
      PRINT "SCORE:", MyClass.Score
      CLOSE #1
      KILL "FINAL.DAT"

SEE ALSO
  FIELD GET (Graphics) PUT (Graphics) LSET RSET MKn$ CVn TYPE