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 Professional Discussion / Detect line number the program is on at the moment?

Author
Message
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 28th Sep 2011 14:03
Is there any way to detect that line of code which DBP is currently on? Would be essential for precise loading bar display.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 28th Sep 2011 14:13
Well i just had a vision about an all-the-time, by-every-line incrementing variable...

..Would pass on this one if possible

But it's gonna do it if there isn't any other options.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Sep 2011 15:07
Quote: "Would be essential for precise loading bar display."

No it wouldn't.

Which line number of the following code would give you loading progress?


A better method (ie, one that works), would be to know that you had a number of resources to load, then count how many you have loaded and display that as a percentage.

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 28th Sep 2011 15:46
For-next or not, their line numbers are still 1, 2 and 3...

Yeah the method at the end is the ultimate solution, though that's what i wanted to defeat by creating a ratio between lines to go, and lines passed.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 28th Sep 2011 17:54
Using the line number will either result in lots of duplicated code or a non-functional progress bar. Why not simply increase a counter each time you load in a resource and use that?

[b]

Login to post a reply

Server time is: 2026-07-10 20:11:57
Your offset time is: 2026-07-10 20:11:57