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 / Hands on DBPro Vol 1 Code Problem

Author
Message
AncientGamer
15
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 16th Apr 2013 03:37
Hello everyone! I have been carefully going through this book, which, by the way, I thoroughly enjoy, and came across code in chapter 12 where TRUE and FALSE are declared as #CONSTANTS. Well, I tried it and I get this error, "Constant name 'TRUE' cannot share the name of a reserved word or command." I can only assume that TRUE and FALSE have been added as reserved keywords. Anyone know if that is correct? I can't seem to find anything on this. I have had no luck searching Forums or DBPro IDE help file. Thanks!
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Apr 2013 04:57
easy enough to test:



Burning Feet Man
17
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 16th Apr 2013 08:42
I love that book! I was so annoyed when they released it digitally a few months after I ordered the hardcopy >_<

The following code works for me, and I run a bunch of the popular DBPro add-in DLLs too;



Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Apr 2013 12:59
More worryingly, this works too, including the highlighting.



but this gives the expected error:



Looks like the handling of reserved words is inconsistent.
AncientGamer
15
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 16th Apr 2013 14:45
@Burning Feet Man:

Code will not compile on my copy. I'm using DBPro v.7.62 with Extends. I have two copies on two different computers, neither will compile this. I still get the error that states Constant name 'True' cannot share the name of a reserved command or keyword. I can work around this but it would have been convenient in some Boolean operations. Thanks for replying!

@Green Gandalf:

That's surprising to see the first code actually work. The other code gave the same error I am receiving when I try to declare TRUE and FALSE as #CONSTANTS. Thank you!
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Apr 2013 20:30
I think Extends has these commands, and use them for the same reason. You should just be able to use them without declaring them.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Apr 2013 22:16
The following just gives 0,0 for me and no special highlighting etc. In other words they are just standard variables so perhaps the error is caused by a Plug-in that I don't have? Is that what you meant?

AncientGamer
15
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 16th Apr 2013 22:59
Thanks @Mobiius. I will probably do that or change the #CONSTANT or Variable to something like isTrue or isFalse and declare them and initiate to 1 and 0, respectively. Thanks for the help everyone!!!
Burning Feet Man
17
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 17th Apr 2013 01:27
Yup, I haven't installed Extends for a while. I believe this expansion is causing your conflict.

Do you recall the commands that you're using & finding useful in extends?

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
AncientGamer
15
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 17th Apr 2013 02:53
I personally haven't used any commands in Extends yet. My plans are to complete Vol. 1, develop a 2D game utilizing animated sprites(probably), then work my way through vol. 2, which I also have on hand, develop a 3D game (probably a simple one, I'm sure) and then continue with development in AppGameKit by going through the Hands on AppGameKit BASIC, if I even need to by that time. That's the plan, at least. Along the way, as I'm going through vol. 2 I plan on picking up on some of the added features of DarkBASIC Pro, including Extends, Dark Occlusion, and possibly some others. Thanks again for the help, it's good to know where the issue is coming from.
Burning Feet Man
17
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 17th Apr 2013 03:35
From my DBPro adventures, I found the best plugins (coincidentally, they're free too!) are;

Advanced2D
Matrix1 Utilites
D3D Function

There's also an Xbox360 DLL which will assist with Xbox wireless controller, it's awesome!

Further to this, I found I became most productive with DBPro when I started using the Indigo Editor, created by Balid. Give it a shot, hopefully you'll love it.

Oh, one last tip is searching. I created a search bookmark which speeds things up when I'm trying to track some information down;

https://www.google.com.au/search?hl=en-GB&q=site:forum.thegamecreators.com+dbpro

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
AncientGamer
15
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 18th Apr 2013 03:16
Wow, thanks Burning Feet Man. I'll check out those plugins as well as give Indigo a try. Nice tip on the search bookmark as well, I just created one. Thanks again.

Login to post a reply

Server time is: 2025-05-17 15:49:17
Your offset time is: 2025-05-17 15:49:17