There are more methods to do this as well. You can write the values directy to the file.
dim B(81) as integer
For x = 0 to 81
B(x) = x-40
next x
if file exist("Myfile.inf") = 1 then delete file "Myfile.inf"
open to write 1, "Myfile.inf"
For x = 0 to 81
write long 1, B(x)
next x
close file 1
undim B(81)
`get values from file
dim B(81) as integer
open to read 1, "Myfile.inf"
For x = 0 to 81
read long 1, B(x)
next x
For x = 0 to 20
print B(x)
next x
wait key
cls
For x = 21 to 40
print B(x)
next x
wait key
cls
For x = 41 to 60
print B(x)
next x
wait key
cls
For x = 61 to 81
print B(x)
next x
wait key
Or you can save the array to the file
`write values to file
dim B(81) as integer
For x = 0 to 81
B(x) = x-40
next x
if file exist("Myfile.inf") = 1 then delete file "Myfile.inf"
save array "Myfile.inf", B(81)
undim B(81)
`get values from file
dim B(81) as integer
load array "Myfile.inf", B(81)
For x = 0 to 20
print B(x)
next x
wait key
cls
For x = 21 to 40
print B(x)
next x
wait key
cls
For x = 41 to 60
print B(x)
next x
wait key
cls
For x = 61 to 81
print B(x)
next x
wait key
There are probably other ways as well. There is always more than one way to do anything