Vista Error with WriteFile?

BlitzMax Forums/BlitzMax Beginners Area/Vista Error with WriteFile?

The following Test Code hangs the app for me in Vista and doesn't write anything to the file.

SuperStrict

Graphics 800, 600

Global Array:Int[10, 10]

For Local x:Int = 0 Until 10
	For Local y:Int = 0 Until 10
		Array[x, y]= Rand(0, 20) 
	Next
Next

Global filetoWrite:String = CreateFile("File.txt") 
Global FileStream:TStream = WriteFile(FileToWrite) 
For Local y:Int = 0 Until 10
	For Local x:Int = 0 Until 10
		WriteInt FileStream, Array[x, y]
	Next
Next
CloseFile FileStream


While Not KeyHit(KEY_ESCAPE)
	
	Cls
			
		
	
	Flip
	
Wend