Page 283 - Learn to Program - Basic-256
P. 283

Chapter 18: Files – Storing Information For Later.                              Page 267



                              seek expression
                              seek(expression)
                              seek filenumber,expression
                              seek (filenumber,expression)

                              Move the file pointer for the next read or write operation to a
                              specific location in the file. To move the current pointer to the
                              beginning of the file use the value zero (0). To seek to the end of
                              a file use the size() function as the argument to the see
                              statement.


                              If filenumber is not specified then file number zero (0) will be
                              used.




                              writeline expression
                              writeline(expression)
                              writeline filenumber,expression
                              writeline (filenumber,expression)


                              Output the contents of the expression to an open file and then
                              append an end of line mark to the data. The file pointer will be
                              positioned at the end of the write so that the next write statement
                              will directly follow.


                              If filenumber is not specified then file number zero (0) will be
                              used.




                1       # appendwrite.kbs
                2       # append new lines on the end of a file
                3       # then display it
                4
                5       open "appendwrite.dat"
                6
                7       print "enter a blank line to close file"



                                                           © 2019 James M. Reneau (CC BY-NC-SA 3.0 US)
   278   279   280   281   282   283   284   285   286   287   288