can someone test this?

BlitzMax Forums/BlitzMax Beginners Area/can someone test this?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I am working on a tile editor. Everything had been working fine for me until it started crashing. it run for about 10 to 15 minutes then it crashes. it crashes in a line after repeatedly executing it hundreds of times and it doesn't allways crashes in the same place. I am assuming is a compiler bug. it gives me a memory exception error. it doesn't write outside of the array, I don't believe but I could be wrong.
this is the code:
SuperStrict 

Type Tmap
	
	Field 	array			:Int[,,],..
			LayersCount		:Int,..
			Layer			:Int,..		
			SpriteIndex		:Int,..
			SpritesAcross	:Int,..
		  	SpritesDown		:Int,..
			VisibleAcross	:Int,..
			VisibleDown		:Int,..
			OffsetX			:Int,..
			OffsetY			:Int,..
			ShiftX			:Int,..
			ShiftY			:Int

	Method Create:Tmap(Across:Int,Down:Int,Layers:Int = 1)

		Self.SpritesAcross = Across
		Self.SpritesDown = Down
		If layers > 6 Then layers = 6
		Self.LayersCount = Layers
		Self.array	= New Int[Across,Down,Layers]
		Self.SpriteIndex = -1
		Self.layer = 0
		For Local L:Int = 0 Until Self.LayersCount	
			Self.clear(L)
		Next

	End Method
	
	Method Clear(z:Int)
		Local x			:Int,..
			  y			:Int
			  
		For y = 0 Until Self.SpritesDown
			For x = 0 Until Self.SpritesAcross
				Self.array[x,y,z] = -1
			Next
		Next
	
	End Method
	
	Method Draw(image:timage)
		Local 	x		:Int,..
				y		:Int,..
				z		:Int,..
				ny		:Int,..
				cR		:Int,..
				cG		:Int,..
				cB		:Int,..
				fx		:Int,..
				fy		:Int,..
				mx		:Int,..
				my		:Int,..
				sy		:Int,..
				sx		:Int
		sx = 10      'minimap start
		sy = 590	 'position
		fx = Self.VisibleAcross+1
		fy = Self.VisibleDown+1
		mx = sx+Self.ShiftX
		my = sy+Self.ShiftY

		SetAlpha 1.0
		For y = 0 Until Self.VisibleDown
			ny = Self.Offsety + (y Shl 5)
			For x = 0 Until Self.VisibleAcross
				Local x1% = x+Self.shiftx
				Local y1% = y+Self.shifty
				If Self.array[x1,y1,Self.Layer]> -1
					Local indx:Int = Self.array[x1,y1,Self.Layer]
					DrawImage(Image,Self.OffsetX+(x Shl 5),ny,indx)
				EndIf
			Next
		Next

		For y = 0 Until Self.spritesDown
			For x = 0 Until Self.SpritesAcross
				If array[x,y,Self.Layer] > -1 
					cR = Self.array[x,y,Self.Layer]
					cG = cR
					cB = 0
					SetColor(cR,cG,cB) 
					Plot(sx+x,sy+y)
				EndIf
			Next
		Next
	
		SetColor 255,255,255
		DrawLine(sx,sy,sx+Self.SpritesAcross,sy)
		DrawLine(sx,sy,sx,sy+Self.SpritesDown)
		DrawLine(sx+Self.SpritesAcross,sy,sx+Self.SpritesAcross,sy+Self.SpritesDown)
		DrawLine(sx+Self.SpritesAcross,sy,sx+Self.SpritesAcross,sy+Self.SpritesDown)
		DrawLine(sx,sy+Self.SpritesDown,sx+Self.SpritesAcross,sy+Self.SpritesDown)
		DrawLine(mx,my,mx+fx,my)
		DrawLine(mx,my,mx,my+fy)
		DrawLine(mx+fx,my,mx+fx,my+fy)
		DrawLine(mx,my+fy,mx+fx,my+fy)
	End Method

End Type
Graphics 1024,768


Local map:tmap = New tmap
Local image:timage = LoadAnimImage("sprites.png",32,32,0,400)
map.visibleacross = 20
map.visibledown = 10
map.Create(600,100,3)
For Local y:Int = 0 Until 100
	For Local x:Int = 0 Until 600
		map.array[x,y,0] = Rand (-1, 399)
	Next
Next 
Repeat
	If KeyDown(key_right) map.shiftx = (map.shiftx + 1) Mod 280
	If KeyDown(key_down) map.shifty = (map.shifty + 1) Mod 90
	Cls
	map.draw(Image)
	Flip()
Until KeyDown(key_escape)

I am using the image below:


the tiles image is a modified version of the Ardi Feldman graphics library found here:
http://www.flyingyogi.com/fun/spritelib.html