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.

AppGameKit Classic Chat / Compiler doesn't recognize included functions anymore!

Author
Message
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 17th Aug 2014 11:00 Edited at: 17th Aug 2014 11:01
Hi,

at some point in my project the AppGameKit compiler (build 108) stopped recognizing functions that I included from a fresh .agc file!
The project is rather large with currently 5 separate source files. I created a new one and just put an empty function in it as usual. Then I included the source file in my main file and tried to call the function but when I hit Compile it always throws a "Could not understand command at line xx" at me!

What's going on? A bug in the compiler/IDE?
Is there some kind of limit when working with multiple source files?

It drives me mad, please help

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Aug 2014 12:04
Do you have a blank row below the last line in the included file?

There are no limits to the number of included files or functions. I have 21 files with multiple functions in each.

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 17th Aug 2014 12:24
Yes, each of my source files ends with a blank line!

This is really strange behavior. It's like the included file doesn't compile. I deleted the SourceCode files in the media folder to see if it helps but it didn't.

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 17th Aug 2014 16:12
I've encountered this problem myself in the past. What I did was the following:

1. Open your project.
2. Create a new file from the IDE
3. When the IDE asks if you want to append the file to your project, answer: yes.
4. Copy the code from your original include file to the new one.
5. Rem out the old include file.
6. Compile and run.

Perhaps not the most elegant solution (it gets rid of the symptom, but the reason functions aren't recognised anymore stays unclear), but it worked for me.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 17th Aug 2014 16:47
Thanks. I tried your approach but it didn't work.
I get the same error!

I wonder what's the reason for this issue.
I'm using Windows 7 by the way.

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Jambo B
15
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 17th Aug 2014 18:59
I'd just double check that all nested loops, if statements, etc. are closed. I had a similar problem to this a while ago. The compiler didn't recognise the nesting problem, but reported an error similar to the one you describe.

Hope this helps,

James
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Aug 2014 19:01
I've had similar issues.
First I adopted a practice of a blank line at the end of the includes plus a line with a remark. Helps a little.
Sometimes I found that I had a function with a UDT parameter and then in the function I accidentally used the parameter as a different type. AppGameKit no longer realized the function bounds.
Also watch out for some string literals. I tried using a constant string with // in it and it wreaked havok when the constant was actually used.

My best suggestion:
comment out code until it compiles

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Aug 2014 19:18 Edited at: 18th Aug 2014 19:24
Ok, so I've doubled checked each and every loop, function and if-statement to be sure and I think I didn't mess up with the bounds.

To be sure, these are allowed and will compile correctly, right? (using AppGameKit v1 Tier 1):





I wonder if consiquently using semicolons at the end of each appropriate line would help...

Quote: "comment out code until it compiles"


Ok, thanks for the advice, gonna take some time.

Oh man, sometimes I wish the reliability of the whole AppGameKit package would be anywhere near C-style languages - or maybe even like any other IDE out there...

Edit:
Ok, so I've commented everything out of my main.agc file ("/* */") and it essentially looks like this now without all the comments:



And the included file looks like this:



And it still won't work! So this leads me to the conclusion that something must be messed up with the project setup somehow. I didn't modify any files outside the IDE!

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Aug 2014 19:22
Your conditionals should be OK, I always use multi-line so I'm not sure if it causes any problems. None that I've heard of at least.
Semicolons shouldn't be necessary. I don't even think they'll work, colons will, but also shouldn't be necessary.

For commenting out, remember you can do block comments with /* */ or remstart remend.
Another thing you might want to try is running it through the v2 compiler. It's parser is much more sensitive and might find something for you.

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Aug 2014 19:26
Quote: "Another thing you might want to try is running it through the v2 compiler."


But I didn't back or buy V2 so that's not an option for me.

See my previous post, I've edited it, did some testing with commenting out code.

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Aug 2014 19:31
No clue. We had issues like this on Windows 8, but never 7.
I guess try making a new project?

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Aug 2014 19:47 Edited at: 18th Aug 2014 19:47
Ok, I think I solved the issue!

At the top of my source files I usually have multi-line comments describing the contents something like this:



When I removed those lines or replaced them with remstart-remend it works!

This programming language can really drive you mad...
So many bugs for the simplest things. But anyway back to working on my game - gonna start by finally moving code out of these monolithic source files

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Aug 2014 19:48

Login to post a reply

Server time is: 2024-11-25 08:01:59
Your offset time is: 2024-11-25 08:01:59