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 / DBPro IDE Include and #Include Woes:(

Author
Message
TechLord
23
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 7th Dec 2007 17:56 Edited at: 7th Dec 2007 18:00
Hi guys I have a working demo of my DarkMachine Scripting Engine w/BASIC Syntax written in DarkBasic.

Unfortunately, I've ran into some quirky-ness with the DBP IDE when I separated the MAIN Execution Loop from the DarkMachine Lib. There are 5 files that are included with the MAIN prog from within the DBP IDE. The code compiles with no errors. However, when it attempts to run it crashes with the Send Error Report Alert.

The 5 files are:
DarkMachine.dba - DarkMachine Compiler & Virtual Machine Engine Lib
String.Lib.dba - Coin's 12 Text Function Lib
dmcvm.h - Contains True DB Source Code Functions use by the functions below
dmcvm_CompilerCallIndex.dba - Contains Compiler Command Lookup Function generated by Code Wizard
dmcvm_ThreadCallIndex.dba - Contains VM Command Select Function generated by Code Wizard

Prior to separating the MAIN from DarkMachine Lib, the code compiled and ran flawlessly. The DarkMachine Lib and MAIN execution prog resided in a single file and all other files were included via IDE. As a single file The MAIN execution prog was located between the Declarations and Functions like so:

DMCVM Consts, Globals, UDTs, Arrays
|
MAIN Prog
|
DMCVM Functions

I read at least one hours worth of Forum-searched Posts to get a grip on the DBP IDE include behavior I could never get the #Include directive to work. Including the files via IDE eventually worked! But needless to say, I desire the DarkMachine Lib to be independent from the MAIN.

Separation was simple. I merely pulled out the MAIN prog between DMCVM Declarations and Functions. I then saved the two as separate files. I created a new project that loads the MAIN prog as the Main Source and includes the 5 files I mentioned aboved via IDE. Now it will compile, but will not run

Get the WIP here: http://www.hpquest.com/techlord/apps/DarkMORG/code/DarkMachine.WIP.zip
Inside the WIP you will find two versions of the *.dbpro file. I reconstructed the working version as DarkMachine.v2.dbpro. The bad version is DarkMachine.v1.dbpro.

Any and all help with this issue will be greatly appreciated.

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Dec 2007 18:00 Edited at: 7th Dec 2007 18:00
I haven't checked the WIP, but make sure the code that creates the arrays actually gets called. For global variables and types this doesn't matter, but for arrays it does.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
TechLord
23
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 7th Dec 2007 18:04
Thanks for the reply Benjamin. I declare the Arrays outside of a function. Do I need to put them into a function, then call the function?

TechLord
23
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 7th Dec 2007 21:13 Edited at: 7th Dec 2007 21:14
Thanks to you both Benjamin and WindowsKiller. I created a Function DimArrays() that Declares the arrays. This function is called first upon initialization. It works!!! IMHO This is still very quirky behavior, but, I now know what to do. Sincere Thanks.

Login to post a reply

Server time is: 2026-06-26 08:43:53
Your offset time is: 2026-06-26 08:43:53