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 / Counting the number of labels

Author
Message
Mew151
18
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 9th Apr 2010 03:47
Is there a way to do this?
I want to find it out, so it can be dynamic for all the code entered in the engine.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 9th Apr 2010 16:00
What are you asking?

The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Apr 2010 16:08 Edited at: 9th Apr 2010 16:09
I have no idea what you mean either. The only thing I can think of, is that you want a list of all the variables your program uses?

There is a tab in the old editor for listing the initiated variables, but not un-initiated ones.

If you are talking about media, images or objects that you want to do this with, then I suggest making a function to write a debug file, then it's quite easy and safe to dump your info into that. I don't think there's much you can do with un-initiated variables.

Again though, we don't know exactly what you mean - Labels aren't referred to in DBPro, as they might be in other versions of BASIC. Give us some more details about what you want to do, and I'm sure someone will have some good advice for you.


Health, Ammo, and bacon and eggs!
Mew151
18
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 9th Apr 2010 17:17
I mean is there a way to count labels that you GOTO to.

Like this:


And I know that using GOTO's is a bad programming habit. I seldom use them, unless it makes the game easier to do.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Apr 2010 17:24
What do you mean by:

Quote: "I want to find it out, so it can be dynamic for all the code entered in the engine."


?
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 9th Apr 2010 18:53
I don't think GOTO labels are handled by DBP except during compilation time. So I'm not sure keeping track of them can be done automatically. But if you use them as little as possible, pen-and-paper may work just fine.... . Of course, you can put a rem'd out section to store where they are and what they mean for you own purposes.

The fastest code is the code never written.

Login to post a reply

Server time is: 2026-07-26 17:36:48
Your offset time is: 2026-07-26 17:36:48