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 / Dark Basic #include and function calls not working in Dark Basic Pro

Author
Message
walt310
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 10th Jan 2003 07:02
When importing Dark Basic programs with external filename.dba all works well. When I run Dark Basic code with #include "filename.dba" and function calls that depend on the external include file, Dark Basic Pro function calls fail. Is there a new way of doing external include files and make function calls to the external #include? ?

If you have to include all source code into one big Dark Basic Pro file, this will no be practical!

The external #include and function calls using the external source code worked great in Dark Basic but NOT working in Dark Basic Pro! I must be doing something wrong. What is the answer?
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Jan 2003 08:17
DBP requires a project file in order to know the pathways etc of the project at hand.

It sounds like u havent created a project file.

make a new folder and copy the files u wnt to use.

open the file within DBP thats the main file and save a project file once u have altered the settings on the right in the project manager.

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Jan 2003 18:57
DarkBasic Pro has ALOT of quirky features... or rather the IDE does.

You need to ADD any files your going to #include into your project, which as indi notes also requires you to save a .dbpro file

i would always test with this simply function if you're able to actually access a DBA



if you add to your project and then use the #include and still can't get the file to add then there is something screwy going on with your version of Pro and i'd recommend sending Lee an email about it.

kinda silly that you have to make sure so much is "pre" setup and yet pro won't even automatically add the '#include "file.dba"' which just seems wrong somehow.
i'm kinda happy i don't have to put up with alot of the quirks of DBpro IDE anymore, cause some are more work than they're there to save you.

Anata aru kowagaru no watashi!
walt310
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 11th Jan 2003 02:22
I have created a new project file and added all the .dba files to the right of the project(the red button with files shows all). Declared functions show all functions. Yet, the main source file makes a function call to one of the include files and seeing #100011 Could Not understand command at line 55. What is the problem? I have been using compilers since Borland Turbo C++ 15 years ago. Someting is wrong with DBPRO. What is going on here?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jan 2003 02:26
If you can put together an example in a zip file for us to download, we can look at what you have done. I'll certainly look at it for you.
walt310
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 11th Jan 2003 03:50
IanM,

I have sent your the zip file.
walt310
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 11th Jan 2003 20:36
IanM,

Thanks, for making the Dark Basic code to work with Dark Basic Pro. I am learning a lot about the syntax on DBPRO that is different from Dark Basic.

Login to post a reply

Server time is: 2024-05-18 15:11:13
Your offset time is: 2024-05-18 15:11:13