< Futurebasic < Language < Reference
WRITE FILE
statement
Syntax
Write File[#] deviceID, address&, numBytes&
Description
This statement writes numBytes&
of data to the open file or serial port specified by deviceID
, starting at the current Òfile markÓ position. The data is copied from the memory which starts at address&
. This is generally the fastest way to write a large amount of data to a file.
Example
This program fragment saves the binary image of an array into an open file. You can later use the Read File
statement to quickly load the array using the data in the file (see the example accompanying the Read File
statement).
_maxSubscript = 200 Dim myArray%(_maxSubscript) arrayBytes& = (_maxSubscript+1) * SizeOf(Int) : Write File #1, @myArray%(0), arrayBytes&
See Also
Write#; Write Field; Read File;
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.