Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / what am i doing wrong?(reading from file)

Author
Message
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 10th Apr 2004 23:19
this gosub is supposed to load a series of track blocks from a txt file, but it only seems to load the last block.



Programs for programmers.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Apr 2004 12:04 Edited at: 11th Apr 2004 12:10
redundant bit of code

if piece(t)=1
piece(t)=1

since peice(t)=1 will only be executed when peice(t)=1 then there is no need for that line since peice(t)=1 is already true, seen as part of something bigger it is hard to say if any errors are there, have you tried checking if the objects exist, if they do then they are just being placed somewhere where you can`t see them, if they don`t get created then try printing q$ and q to see if they hold the values you expected, check what the file you are loading from contains, it may be that whatever you used to make the the file has saved the information incorrectly, hope thats some help.

Mentor

ps: you could also try writing a simplified version that just prints up the values in the file and then expand that bit by bit, often thats a good way to find and kill unwanted bugs when they are well hidden

pps: if you made the file in word and saved it as txt then you may be surprised to find that it gets encoded to a degree when saved as a file, so it may be that is causing the problem, try reading it back from a darkbasic routine if that is the case to check, theres a reason why a couple of lines in word need 4k filesize (hidden control and formatting characters for eg)

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.

Login to post a reply

Server time is: 2025-05-23 06:03:45
Your offset time is: 2025-05-23 06:03:45