Futurebasic/Language/Reference/write file

WRITE FILE

edit

statement

edit

Syntax

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

Description

edit

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

edit

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

edit

Write#; Write Field; Read File;