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.

Newcomers DBPro Corner / Force explicit variable declaration ??

Author
Message
TyN
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Australia
Posted: 31st Aug 2003 06:29
Hi,

I am using the trial version of Dark Basic Pro and I have a couple of questions. Hopefully someone can halp me out before the trial period runs out.

1. Is there a way to force explicit variable declaration. Like the "option explicit" command in Visual Basic. This should help me catch my typo's.

2. Is there a debugger? All I seem to be able to do is compile or run the code.

These are pretty basic questions, and yes, I have already searched the forum.

Thanks,
Ty
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Aug 2003 07:01 Edited at: 31st Aug 2003 19:43
1) No, I don't think so. Actually, that is one of the things I like about basic over other languages. You could just do all your variables as arrays, for example, instead of variable "life", use "life()" with the dim statement. You can make the arrays hold only one value, or use the same array for many variables, such as "playerstatus(10)", 1 for lives, 2 for health, 3 for x position, etc., etc.. Otherwise, you could just learn to spell correctly.

2) Yes, go to compile, then "Run in Debug Mode". You can also press F6.

"All programmers are playwrites and all computers are lousy actors" -Anon
[img]Visit my site![/img]
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 31st Aug 2003 07:52
DB sucks as far as scope, declarations, functions, anything OOP, syntax, IDE catching errors, the list goes on and on and on and on and on and on and on and on...........................but it's all we have, so................

-RUST-
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 31st Aug 2003 18:36
No, DBPro does not have an "option explicit" command or any equivalant to that. Like andrew11, others have called for one so maybe in a future patch.

As for running the debugger, press F6 to run in debug mode or F7 for step through mode. But watch out, the debugger is a tad unstable, should be fixed soon I hope (crosses fingers).

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
TyN
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Australia
Posted: 1st Sep 2003 08:14
Hi,

Thanks for the help. I found the debugger and gave it a quick try.

andrew11: It's not my spelling that I'm concerned about, it's my typo's after I declare a variable name. I always seems to type heigth instead of height when my typing is trying to keep up with my thinking.

I think I will give BlitzBasic a try. I have heard that it has similar functionality to DarkBasicPro.

Thanks
Ty
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 1st Sep 2003 08:26
Oh dear, are we going to have to aplogize to the DB team for scaring away a potential customer hehe

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
TyN
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Australia
Posted: 2nd Sep 2003 10:55
Hey, I'm not gone yet. Just checking out all my options. If DarkBasic is better than BlitzBasic then I will use it.

Login to post a reply

Server time is: 2024-09-20 21:40:20
Your offset time is: 2024-09-20 21:40:20