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 / Could not find field...

Author
Message
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 10th Jan 2014 12:41 Edited at: 10th Jan 2014 12:42
I have no idea on why I'm getting this error when I try to compile. I've defined "active" as an integer at the top of the code. Yet every time I try to compile I get:

"Could not find field 'active' in type 'integer' at line 35."

Can someone help me?



AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 10th Jan 2014 13:44
while probably unrelated, but why does the set_game_state function have two endfunction statements in it ?

kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 10th Jan 2014 14:07 Edited at: 10th Jan 2014 14:09
Because I tried to keep it as close to the source code supplied by @TheComet

Original code from my other post. Supplied by @TheComet. Link to original post http://forum.thegamecreators.com/?m=forum_view&t=206951&b=1



I probably would've taken the extra "endfunction" out but I can't even get the code to compile that far.

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 10th Jan 2014 14:18 Edited at: 10th Jan 2014 14:29
To exit a function prior to the end, use Exitfunction

eg.




Is the code you posted the complete code your trying to compile or a snippet from it ?

if it's the complete code, then there's a number of missing declarations like SplashScreen_1_State and clearscreen() for example.


Edit: Looking at the code, you've a naming collision occurring between the Global instances of GameState and the local instance of GameState that's being passed into the set function.

Here's a quick hack that seems to compile with some stub functions added to make it compile.



kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 10th Jan 2014 14:45 Edited at: 10th Jan 2014 14:50
That does compile Thank you!

Question... Do I even need this line or am I missing something?



I deleted the line and the code compiled just fine.... Hmmmm?

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 10th Jan 2014 15:08
I got it now nevermind!

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 10th Jan 2014 15:24
Actuall I have one more question!!!!

Do I need the part of code that's in the main loop? If the functions I'm calling have loops inside of them I never actually end up using the main loop itself.

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Jan 2014 17:40
Well since I don't see the functions, I can't say how the loops work in the functions. But I'd guess they all have some condition that allows the loop to exit and thus the function will end, returning back to the main loop.

Login to post a reply

Server time is: 2026-07-06 07:50:42
Your offset time is: 2026-07-06 07:50:42