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 / Excluding Includes?

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Feb 2006 22:12
Anyone know of a way to exclude includes until a certain time?

I've tried a basic if statement, something like;
[/code]
Include = 0
IF SPACEKEY()=1 THEN Include=1
IF Include = 1 THEN #INCLUDE "Source.dba"[code]

Ofcourse that wont work alone but you get the idea, the compiler skips over the If statement to the #INCLUDE command.

Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 13th Feb 2006 22:29 Edited at: 13th Feb 2006 22:31
couldnt you just place the code you want to include in your program and put it inside an if then statement to see if it will be included
example:


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Feb 2006 22:31
I think you misunderstand include files. They are not a programmatic concept, just a way to help you organise your source code. The compiler doesn't give 2 hoots where the code is, it will compile everything in it's own way.

Excluding include files in code is mixing the concepts of program and aesthetics.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Feb 2006 22:37 Edited at: 13th Feb 2006 22:38
Theres a reason to my madness.

I was trying to have the user input a single line string, then save that string as a .dba file. I got that working fine. Then I was going to have the compiler include the newly created source file when the user presses the space key (for testing purposes). Ultimately allowing the user to program the program as they're running it, Real-Time programming.

@Jerok: I said that I had tried that to no avail in my first post.

FeelX
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location: Somewhere in Germany
Posted: 13th Feb 2006 22:58
Hi,
you cannot include files while runtime because the DBPro parser checks before it compiles your code if the include files exist and then the linker links all includes to one code. Real-Time coding is only possible through a kind of scripting language.
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 13th Feb 2006 23:02
no i was trying to say not to use the include file cammand and just use the code from the file itself but seeing what you are trying to do i see that it is impossible

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Feb 2006 10:46
Take a look at DavidT's Lua (The Unity plugin) or Torrey's DarkScript plugin.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 14th Feb 2006 12:51
I knew you could do it with plugins I was curious if it was possible with DBP commands alone. Its alright it was just a little 5 minute idea I had.

Login to post a reply

Server time is: 2024-09-24 15:34:27
Your offset time is: 2024-09-24 15:34:27