Help! not working...

BlitzPlus Forums/BlitzPlus Programming/Help! not working...

This Works:
SeedRnd MilliSecs()

bank=CreateBank(16*2)

Dim char$(3,3)

Print "*****************************"
Print "Here is the arrays Characters"

off=0
For u=0 To 4-1
For v=0 To 4-1

char$(u,v)=Chr$(Rand(65,65+26))

Print char$(u,v)

poke=Asc(char$(u,v))

PokeInt(bank,off,poke)
off=off+1
Next
Next

Delay(1000)

Print "*****************************"
Print "Here is The Banks Equivalent"
off=0
For u=0 To 4-1
For v=0 To 4-1
Print Chr$(PeekInt(bank,off))
off=off+1
Next
Next

Input()
End


But this doesnt:

debug=true

;LOAD AREA
	filename$="filearea.map"
	If Not FileType(filename$)=1 Then RuntimeError "Area Doesnt Exist!"
	
	 file=ReadFile(filename$)
	 	ReadShort(file):ReadShort(file);Read the W and H (blanks as in this game w=16 and h=11 always)
	
	offset=0		;offset=0 to allow bank poke with it
	 For u=0 To 16-1
	 	For v=0 To 11-1
			tilever=(ReadShort(file)-1)
	 		PokeShort(BANK,offset,tilever)
	 		offset=offset+1
			If debug Print tilever	;Thus proving that all the READ VALUES ARE CORRECT, and yet later on....
	 	Next
	 Next

	 CloseFile(file)
print "***********************************"
;READING
	offset=0
	For u=0 To 16-1
	For v=0 To 11-1
		tilever=PeekShort(BANK,offset);
		offset=offset+1
		If debug Print tilever	;Each Comes out as about 30000 greater than what it was before....
	Next
	Next

input():end





Why Not???

{ie: The Values in the Bank that are read are not the ones put in}

you're using short with an offset of 1 shorts are 2 bytes long so you'll have to use an offset of 2 and maybe recalculate the bank size (x2)

peekbyte => 1 byte long offset in the bank 1
peekshort => 2 bytes long offset in the bank 2
peekint => 4 bytes long offset in the bank 4
peekfloat => 4 bytes long offset in the bank 4

hope it help :)

i should be slapped for that!
Thanks!