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 AppGameKit Corner / Returning Values from Functions

Author
Message
MadCatXIII
9
Years of Service
User Offline
Joined: 9th Aug 2015
Location:
Posted: 9th Aug 2015 03:13
I searched the forums for any similar topics and did not find any, so I apologize if this has already been covered somewhere else.

I just purchased a copy of AGK2 in the recent Game Makers Humble Bundle.

I've been having a pretty good go of it so far, but I've hit a snag that has me stuck.

I'm trying to write a generic XML parser and the AppGameKit player is convinced that one of my functions is returning an integer, even though it is currently returning a user defined type.



And here is the section of code that calls the above function:



The error I keep getting is:
xmlparser.agc:233: error: Tried to assign Integer to Type
which is the line where parselines calls the __XML_ParseNodeVals function.

Any ideas? It's a good possibility that I'm just too close to the code to see my error.

Thanks,

Clay
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 9th Aug 2015 16:14
I'm not sure if it's whats causing your problem or not, but in your function definition you state that it needs a parameter of "line as integer[]", but when you call it, you don't pass the value. In fact, you haven't included the brackets at the end of the function call either.

Not at PC atm so can't test I'm afraid.

MadCatXIII
9
Years of Service
User Offline
Joined: 9th Aug 2015
Location:
Posted: 10th Aug 2015 00:50
Thank you!!!

I missed that entirely! I was afraid it was something silly that I just couldn't see.


I'm guessing that AppGameKit defaults any variables (or what it thinks are variables) to integers types. At least I will know for future reference.

I can get back to debugging now. Hopefully I can get this finished and turned into something useful.

Thanks again!

Clay

Login to post a reply

Server time is: 2024-11-21 20:56:36
Your offset time is: 2024-11-21 20:56:36