|
<< Index >> |
FutureBasic |
write dynamic | statement | |
|
write dynamic deviceID, arrayName
CFURLRef desktopURL, url
long j
dynamic myAry(1 ) as long
//Construct URL for file access
desktopURL = fn FileManagerURLForDirectory ( NSDesktopDirectory , NSUserDomainMask )
url = fn URLByAppendingPathComponent ( desktopURL, @"Test Read_Write Dynamic " )
//== Load Array ==
for j = 0 to 9
myAry(j) = j
next
//== Write Array To File ==
open "O" , 1, url
write dynamic 1, myAry
close 1
kill dynamic myAry
//== Read File Contents into Array ==
open "I" , 1, url
read dynamic 1, myAry
close 1
//== Prove File contents are available ==
for j = 0 to 9
print myAry(j)
next
WorkspaceRecycleURL ( url ) // trash test file
See also
dynamic;
read dynamic