Runtime error at line (-10) [solved]

Started by AnasAbdin, Sun 20/09/2015 08:19:31

Previous topic - Next topic

AnasAbdin

I got this error message and I have no idea what's causing it  :-\

Runtime error: Function still open, missing }    |     GlobalScript.asc     |    line -10



AGS v3.3.3, December 2014
640*400 32 bit
Windows 7 Professional

AnasAbdin

...heh! Found the effin bracket  :-[

Slasher

Good (nod)

it also pays to save your game very often then you know instinctively your last scripting movements should an error occur ;)


AnasAbdin

Thanks mate  ;-D
That's exactly how I figured it out.

Crimson Wizard

How was it possible anyway? First, it sais "runtime error" - did it occur when game was run as opposed to compilation? If it did, then how did it compile at first place.
Second: line -10?

Can you give more info on how did this error occur? I think there might be something wrong with AGS.

Cassiebsg

I often encounter "-" lines... assumed that's AGS way of saying that it's not sure which script line is the cause?
Can't remember in which occasions I often get that though, sorry.
There are those who believe that life here began out there...

AnasAbdin

CW: I will mimic the same conditions to produce the same error and get back to you with this asap.

AnasAbdin

Thanks Cassiebsg  for the note, and sorry for the double post  :-\
CW, here's exactly what I just did now:

I undid the addition of the bracket } which solved this topic. Then Ran the project (F5) and got exactly the same error:







Then:

Quote from: AnasAbdin on Sun 20/09/2015 08:19:31
I got this error message and I have no idea what's causing it  :-\

Runtime error: Function still open, missing }    |     GlobalScript.asc     |    line -10



AGS v3.3.3, December 2014
640*400 32 bit
Windows 7 Professional

Gurok

From memory, AGS will classify an error as a runtime error if it doesn't have a line number associated with it. Presumably, this means it got to the end of the input stream without finding '}'.
[img]http://7d4iqnx.gif;rWRLUuw.gi

Snarky

AnasAbdin, I think what would be useful here is to know where the bracket was missing, e.g. from the first function in GlobalScript (and was it the bracket containing the whole function or an internal bracket?), the last function, somewhere in the header, or what.

Crimson Wizard

Quote from: Snarky on Mon 21/09/2015 08:57:26
AnasAbdin, I think what would be useful here is to know where the bracket was missing, e.g. from the first function in GlobalScript (and was it the bracket containing the whole function or an internal bracket?), the last function, somewhere in the header, or what.
Yes, this is what I wanted to know :).

MiteWiseacreLives!

I get those negative line errors when I forget a closing bracket at the bottom of a script. :-\ But get Anas' story none-the-less

AnasAbdin

ok sorry about that.
The bracket was missing from the last function in the Global.asc

The structure of the function is like this:

Code: ags

function pyramid_bgo_OnClick(GUIControl *control, MouseButton button)
{
		while ( ... )
		{
			...
			...
			if ( ... )
			{
				...
			}
			else
			{
				if ( ... )
				{
					...
				}
				else
				{
					...
					return;
				}
			}
		}
		...
		...
}  // <-- this was the forgotten bracket & the final line in the script

Crimson Wizard

Okay, thank you, I could reproduce by putting this in the end of the script:
Quote
void F()
{

I will open a new issue, because the error message should be fixed.

AnasAbdin

Thanks Crimson really appreciate it  :)

SMF spam blocked by CleanTalk