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 / Can y'all try these bits of code and tell me what happens...

Author
Message
Fluffy Paul
22
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 6th Mar 2003 04:53
Hi there.
Run this code and note what happens:



and now run this and tell me what happens:



Thanks!
Ending a sentence with a French word is so passé
Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 6th Mar 2003 13:55
just out of interest.. why are you asking us to do it? hav'nt you got dbpro yourself? or are you asking us to debug this? [img][/img]

I have a word of advice...
..don't piss on an electric fence!
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Mar 2003 17:19
well thats certainly weird... a bug perhaps?

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 6th Mar 2003 19:23
First one does nothing, second one displays 0, 1, 1, biatch.

Once I was but the learner,
now, I am the Master.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Mar 2003 19:29
If you put a goto to jump past the function it works OK. My best guess is that the compiler needs to have the 'main' code defined before any functions.

Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 7th Mar 2003 02:43
yep I have to put ALL my functions below any code, loops subroutines etc otherwise it ignores everything after them - kinda weird but I'm used to it by now

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
Fluffy Paul
22
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 10th Mar 2003 19:29
Now that's what I'm getting at.
I'm trying to write a gui system that I can #include in any of my prjects. The gui source file has a type definition, some arrays being dim'ed and some function for doing stuff.
Because DBPro is obviously twitchy about where functions go I can't modularise my code at all. The included functions count as being at the top of my main source code when I compile and this means that they don't work as my origianl snippets demonstrated.
"Code Reuse" has never involved so much cutting and pasting before!

It's a bit of a pain as my confidence in DBPro has been slightly undermined as I can't now be sure that compiler/runtime errors are actually me being wrong - it might be DBPro!

Ending a sentence with a French word is so passé
Andy Igoe
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 10th Mar 2003 19:34
All of my #include's feature functions (infact, only functions), however I include them using the project manager 'files' menu rather than the #include command.

Perhaps that will fix your woes.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Mar 2003 20:13
The editor puts all the included files at the end of your source.

If you want to use the #include command, put them at the end of your main source.

Login to post a reply

Server time is: 2025-05-18 21:20:32
Your offset time is: 2025-05-18 21:20:32