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.

Dark GDK / dbStr$ undeclared identifier?

Author
Message
DavidD
18
Years of Service
User Offline
Joined: 6th May 2006
Location:
Posted: 29th Jun 2008 00:20
Is there an extra #include < > needed for using certain commands in DarkGDK?? I'm trying to use dbText to display x,y,z camera coords on the screen. I have a variable CPX representing the camera X location. Using dbStr$(CPX) in the dbText command returns the following error: 'dbStr$': identifier not found. Yet it's listed in the DarkGDK help file?



Thanks.
Jason C
16
Years of Service
User Offline
Joined: 19th Jun 2008
Location:
Posted: 29th Jun 2008 00:57
remove the "$" so its dbStr() instead of dbStr$().
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 29th Jun 2008 01:04
No dollar sign.




My site, for various stuff that I make.
DavidD
18
Years of Service
User Offline
Joined: 6th May 2006
Location:
Posted: 29th Jun 2008 01:12
Wow thanks. But how was I supposed to know that when the .chm example lists Str$()?

Thanks again.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 29th Jun 2008 01:36 Edited at: 29th Jun 2008 01:36
DBPro documentation. They left some of it in there. They didn't do a wonderful job with it.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 29th Jun 2008 01:43 Edited at: 29th Jun 2008 01:44
Also, you might try using sprintf to print variables. Check it out:


The advantage here is that you can label the text output. That %f stands for a float, though you can have %c for a char, %d (or %i) for an int.



Experiment!


My site, for various stuff that I make.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 29th Jun 2008 01:46 Edited at: 29th Jun 2008 01:48
Quote: "But how was I supposed to know that when the .chm example lists Str$()? "


$ (ding) isn't a valid character for an identifier in C/C++. The only valid characters are 0-9, a-z, A-Z, @ and _. A numeric value cannot be used as the first character.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
DavidD
18
Years of Service
User Offline
Joined: 6th May 2006
Location:
Posted: 29th Jun 2008 02:05
Thanks SunDawg! Thats cool.

Login to post a reply

Server time is: 2024-09-30 01:26:39
Your offset time is: 2024-09-30 01:26:39