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 / include files causing problems

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 12:33 Edited at: 5th Sep 2003 12:33
I have a DB Classic program which worked quite happily. It includes half a dozen include files, which it was also very happy with.

I have tried to compile this in DBpro (AlienWare trial version), because I am having problems and guessed the proven working program might help me out. I've converted all the bits of code that have changed for DBpro.

Everything goes horribly wrong as soon as it tried to bring in the include files. I know the code is correct, but somehow the fact that it's in an include throws the compiler. An example message is:
Quote: "
#100008: Parameter for LOAD IMAGE do not match 'Filename, Image Number' inside includesMakeSkyBox.dba"


The code is quite simple...

Quote: "
FUNCTION MakeSkyBox(id, range#)
LOAD IMAGE "./skybox/sbf.bmp", id + 1
..."


Can anyone tell me why I am having these problems with includes in DBpro that I never had in Classic? This is the second project with this issue. If I put the include code into the main source file, it works fine.

haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Sep 2003 12:36
It depends on how you actually include the code, there is a source files tab on the IDE which will allow you to include files, which should actually work.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 12:50
I've added them to this tab. For my original project, I created the files using the IDE as well. The weird thing is that it's reporting errors on the code, so it can read it OK.

I'm wondering if it's because I'm passing parameters to it, across source files. I know in theory this shouldn't be an issue because the net effect of includes is that they are one and the same piece of source, but something somewhere is not a happy bunny.

FieldDoc
21
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 5th Sep 2003 16:15
I thought that this was a known bug. Whenever I try to include any media files at all in my projects I get a failed to load IMAGE error message if I run the EXE out of my projects folder.

Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 5th Sep 2003 16:52
Don't include it into project. Use only #include in your main program. I think thats error in IDE.
haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Sep 2003 17:50
Including using the IDE works perfectly fine here. Have you got all the updates installed?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 18:45
I'm using the AlienWare demo version - I guess I can't patch it.

...just put 3 of my functions back into an include, and removed the file from the project files list (still "#INCLUDE"'ed)

Hey Presto! Bobs the brother of my mother! Just need to put 18 more functions back into 5 other includes...

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 18:49
...but now I can only open one source at a time!!!

ChipOne
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 5th Sep 2003 18:53 Edited at: 5th Sep 2003 18:55
i'm going to say the exact opposite of Beavis.

includes, if i understand it correctly, are going to be deprecated and should not be used in dbp.

make sure you're not using them and only include files by the method you described above (adding them through the IDE).

sometimes it's not really related to the exact command, but rather to the implementation and misinterpretation of some other piece of code. here are some things that trip up the compiler:
- having a function or type at the top or bottom of an included source file. try putting a comment at the top or bottom
- duplicate function names in different include files
- having a funtion paramater, a constant or a global named the same. there were previous problems with having partly similar names, but i believe these have been resolved since patch 3 (ie. #constant var and global variable would trip up the compiler because it would see the 'var' in 'variable')

also, for clarity, you might want to try typing out your function parameters:
FUNCTION MakeSkyBox(id AS INTEGER, range# AS FLOAT)

hope this helps. cheers.

edit: also, one more thing. if you have a function earier in your source that is missing an ENDIF or an ENDWHILE etc. then this might be confusing the compiler and giving you an incorrect error message as well, EVEN IF the confounding source is in a DIFFERENT source file. check to make sure you're not dangling participles.

-= i only do what my rice krispies tell me to do =-
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 19:34
I'm not dangling my participles for anyone!! I love that phrase, I'm gonna use it at work next week! I might just dangle one so that I can use it! The post-graduates dangle their participles everywhere and then come looking for help. Fantastic! You've made my day!

anyway...I'm happy that the code is OK...like I say, I moved it all in to the main source to check. I MUST have includes, I like to group my functions by function (!), not alphabetically, the functions window is pants for finding them again.

I've dabbled with the suggestions, but no combination seems to work. So, I have another solution...

I have 2 projects. The first gives me access to all the source via the files window. The second is a project with only the main source listed. This one is used to compile!

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th Sep 2003 20:28
I have includes and they are full of functions all giving each other parameters and it works fine.

Remember that to be able to load media you need to have a .dbpro file in your prject.

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 22:36 Edited at: 5th Sep 2003 22:36
Quote: "Remember that to be able to load media you need to have a .dbpro file in your prject."


Yeah...I got that. I'm guessing that the AlienWare demo version is not in synch with the latest patches. I have my workaround for now...it'll be after the compo that I invest in the full version so I'll see how it goes with the full version with Patch 6 or whatever we're on by then.

the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 5th Sep 2003 23:12
Right click on the editor.exe file and look at its version info.
I get "1.0.9.2" which is the latest version as far as I know. If you don't have the latest version try updating it even though you have the trial.

Also note error reporting isn't one of dbpros strong points. It occasionly reports errors on the wrong line.

I don't know how the compiler treats file included with incluede# but I do know the ide appends files in the include tab onto the end of the main source. If the compiler inserts the include files at the point of the include# statement it could result in different behaviour when useing the different methods.
ChipOne
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 5th Sep 2003 23:15
to further complicate the problem, earlier versions of the IDE did not properly compute the line number of included files and could carry you to the wrong source. remeber to patch up your IDE as well (although this was fixed some time ago, i'm not sure what they stuff in the demo version).

cheers.

-= i only do what my rice krispies tell me to do =-
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Sep 2003 01:26 Edited at: 6th Sep 2003 01:26
OK...I'm gonna try deleting the #include lines in the main code, see what happens. I'll have to move the type declarations in, 'cos they won't work if they are appended to the bottom.

Think outside the box...I hadn't considered this one. Shame on me, I pride myself on finding the solutions no-one else can see.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2003 18:44
You can keep your type declarations in an include:



Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Sep 2003 23:45
It's all working fine now... deleted the #Includes in my code. I've got my types in an included file, the works.

Thanks for all the help!

Login to post a reply

Server time is: 2024-09-20 21:33:16
Your offset time is: 2024-09-20 21:33:16