Thanks!
It works when i put the filename as the command line, but doesnt when i open a file: It states 'Invalid Stream Handle'
I'll give it a good look over to see what i've done wrong
(probably variables mixed/localised or something hastily stupid like that...)
Edit: hmm. couldnt find the problem.
Alright, Heres my code (sampled):
Global loadingfirst$=CommandLine$()
Type tile
Field ver
Field x
Field y
End Type
Global b.tile
Global tilesetimage,tilefilename$="",nTilevers,xtiles,ytiles,MouseTile=-1,utiles=75,vtiles=75,mx,my,mapfilename$="",ReplacedMouseTile
If Not Asc(loadingfirst$)=0
OpenTileMap(1)
EndIf
Function OpenTileMap(beginfile=0)
If beginfile=0;check if command lien is enabled!"
choice=Confirm("Are you sure you want to open?")
If choice=0 Then Return False
choice=0
oldmapfilename$=mapfilename$
mapfilename$=""
mapfilename$=RequestFile("Open a Map","zmap,zfront")
If mapfilename$="" Then mapfilename$=oldmapfilename$ Return False
Else
mapfilename$=loadingfirst$
EndIf
;remove current memory status(if opening in menu)
For b.tile=Each tile
Delete b.tile
Next
Print mapfilename$;-always comes up with the correct file...?
;open the file to read
file=ReadFile(mapfilename$)
If file=0 Then RuntimeError("file handle failed: "+mapfilename$);keeps happening...?
utiles=ReadByte(file)
vtiles=ReadByte(file)
For u=0 To (utiles-1)
For v=0 To (vtiles-1)
b.tile=New tile
b\ver=ReadShort(file)-1
b\x=16*u
b\y=16*v
Next
Next
CloseFile file
End Function
Like i have said, it works within Blitz, but once compiled, fails to work......Help