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 / Functions With Multiple Files

Author
Message
Michael73
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 25th Sep 2010 06:36
Hello, ive never had to work with multiple files in dbp but i decided i might give it a try. But now im trying to have some functions in one file and then run the function in the main file. But i keep get an error that says 'The name 'functest' duplicated inside program inside Functions.dba'. How can i fix this?
T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 25th Sep 2010 14:16
how did you make the multiple files?

with #include or in the ide itself?

you can do one of them but not both. if you do in the ide you dont have to #include them.

*happy coding on his 3D Construx Editor*
Michael73
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 1st Oct 2010 09:53
I only did it in the IDE and I have no includes. Im still getting the error.
CSL
15
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: USA
Posted: 1st Oct 2010 22:48
You must #include "the function program" on your calling program. The function program must be in the same folder as the calling program. The functions themselves should be in the function program only.

CSL
Michael73
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 8th Oct 2010 10:25 Edited at: 8th Oct 2010 10:28
So does that mean I can't declare a function in one file and use it in another? The main file has the include but its still coming up.
Michael73
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 8th Oct 2010 11:28
Wait dont worry, I just closed DBP and opended it again and it worked ... Strange

Login to post a reply

Server time is: 2024-09-28 22:24:21
Your offset time is: 2024-09-28 22:24:21