Not displaying data from open file??

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

Can anyone tell me what I did wrong here? The file exists, I checked it with a hex editor for anomalies. Most lines are under 40 characters in length and terminated properly. SOme days this works, others it doesn't. I'm running under WIndows XP corporate (where nothing stays the same damn it)


If OpenWindow(0, 200, 200, 500, 500, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")
DrawingOutput(WindowID())

j = 20

File$ = "d:\trackfmt.txt"
If OpenFile(#1, File$)
While eof() = 0
Stuff$ = ReadString()
Locate(20,j): DrawText(Stuff$)
j + 1
Wend
EndIf

Closefile(#1)

StopDrawing()

Repeat
ev.l=WaitWindowEvent()
Until ev.l=#PB_EventCloseWindow

EndIf

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Mr.Skunk.

Hi,

Use ReadFile() instead of Openfile (bug)

Hope it helps...

Mr Skunk

Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Hi,

Use ReadFile() instead of Openfile (bug)

Hope it helps...

Mr Skunk

Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st
My God, I don't believe it was so simple. I had been tearing my hear out for 3 days over that one!! All of it works now and am working on the rest of the code. Am also doing the stripping and replacing of elements as I read them in. Now I can get on to the next part, doing the cleanup of any NFO like text portions!!

Cheers, Fangles

Fangles
Post Reply