Futurebasic/Language/Reference/write file

WRITE FILEEdit

statementEdit

SyntaxEdit

Write File[#] deviceID, address&, numBytes&

DescriptionEdit

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.

ExampleEdit

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 AlsoEdit

Write#; Write Field; Read File;