Also move CloseFile to be called very last, outside the for-loop. And move OpenToWrite outside the for-loop before the for-loop. You only need to call these commands once. Right now, having them inside the for-loops, you are calling the commands 6 times each function call, also there is no way knowing that the file will write and be read the same way each time because you're opening than closing the file for each individual array line...very bad, very very bad.
Example:
Function SaveValue( file$ )
valuefile = OpenToWrite( file$ ) `create file to write
`cycle through array and save variables
For a = 1 to 6
WriteLine( valuefile , Array[ a ] )
Next a
CloseFile( valuefile )
Endif
EndFunction
Function LoadValue( file$ )
If GetFileExists( file$ ) = 1
valuefile = OpenToRead( file$ ) `open file to read
`cycle through array and load variables
For a = 1 to 6
array[ a ] = ReadLine( valuefile )
Next a
CloseFile( valuefile )
else
error = 1 `if file doesn't exists, error = 1
endif
EndFunction error
Good luck!