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 / Header files in DBPro

Author
Message
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 2nd Nov 2003 07:15
Ok, I've heard this is possible, but if not, don't shoot me.

How would I include a header file in a DBPro program? (Not necessarily a header file like .h, instead one containing functions that I've written, yada-yada-yada). I tried the searching for the obvious "include" command in help, not there. So...how would I do it? Sample code would be great. Thanks.

Team EOD :: Programmer/Storyboard Assistant
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Nov 2003 07:53 Edited at: 2nd Nov 2003 07:53
You can use INCLUDE, or the append sources through the IDE..




Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Nov 2003 09:24
goto????

YAK!

-RUST-
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 2nd Nov 2003 13:13
#include is the command ... and you must include the file using the current folder as a base.
In addition U5.x no-longer appears to support this feature.

It is safer codewise and time saving to add the files in using the include button without your IDE for dbp.
However I do think that U6 should allow us to use the #include command as the include button allows us too rather than how it is used legacy wise.
As personally I prefer being able to declare my included programs at any given point. Particularly like PureBasic's IncludeX feature which means if the file is already included it is ignored however if it isn't then its included which can be good as there is currently no way to check such things.


To Survive You Must Evolve... This Time Van Will Not Escape His Fate!
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Nov 2003 15:27
'goto' gezz don't faint, labels are evil . Anyway since include pulls the file in 'as is', you'd be running whatevers in the include(s) headers. Could be nothing, could be something.

If DB had contional complation, it wouldn't be an issue, or just wedge the includes at the base of the parent source.

Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 3rd Nov 2003 01:03
@ Raven,

Please tell me that I can still #include my .dba source files with the nice lines of functions in the main program under v.5.1b???

#include still works yes? does it work if the files containing functions, arrays and/or types are in the same folder?

pls explain in simple terms for simpleton (me)
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 4th Nov 2003 01:12
@ Raven,

is #include still working in any way form of manner?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Nov 2003 01:17
Yes it does, but I find that I can only get it working with full pathnames, so I prefer to use the IDE interface instead.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 4th Nov 2003 15:38
yeah as Ian says... it changed from context paths to absolute

so say you're game is in c:\games\doom ... and your include files are in another subdirectory called include.

rather than writing

#include "include\bsp.dba"
you have to write
#include "c:\games\doom\include\bsp.dba"

frustrating at best


To Survive You Must Evolve... This Time Van Will Not Escape His Fate!
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 4th Nov 2003 17:12 Edited at: 4th Nov 2003 17:13
It's no big deal having to explicitly define the include path. You only have to do it once. There are many bigger issues with the compiler that need much more attention.

The more you see, the more you know.
The more you know, the more you see.

Login to post a reply

Server time is: 2026-07-26 16:03:40
Your offset time is: 2026-07-26 16:03:40