FutureBasic Logo

<<    Index    >> FutureBasic 5

write dynamic   statement

write dynamic deviceID, arrayName

write dynamic sends the contents of a dynamic array to an open disk file. Data written to a file in this manner can be read back into memory with read dynamic.

dim as FSSpec fs
dim as long j
dynamic myAry(_maxLong) as long
fn FSMakeFSSpec( system( _aplVRefNum ), system( _aplParID ), "Test", @fs )
for j = 0 to 9
 myAry(j) = j
open "O", 1, @fs
write dynamic 1, myAry
close 1
kill dynamic myAry
open "I", 1, @fs
read dynamic 1, myAry
close 1
for j = 0 to 9
 print myAry(j)
fn FSpDelete( fs )

See Also:
dynamic; read dynamic; write dynamic