Compile Error - PLEASE HELP! (SOLVED)

Started by MissyChelle, Thu 29/09/2005 18:59:02

Previous topic - Next topic

MissyChelle

So now I have another error message on my screen. This is what it says:

There was an error compiling your script. The problem was: In: 'Global Script'

Error (line 55) : Expected '{'

So I have no idea what this means or what to do?
~*MissyChelle*~

DoorKnobHandle

Could you please share your code around line 55 with us?

It seems like you forgot a '{' somewhere in your script, where it needs to be placed.

For example something like:

Code: ags

function test
// bla
}


Notice how the first '{' misses...

Could be something else ( like an ending bracket '}' too much ) though, too.

RickJ

CUrly braces,  "{}", are used to delineate blocks or groups of code.  The are normally used with if, while, and function statements.  So for every opening brace "{" there must be a corresponding closing brace "}".   Such code blocks may be nested so that there are blocks within blocks.

From the text of your  eror message it is likely that you have more closing braces "}" than opening braces. 

These kinds of errors can be very difficult and time consuming to locate because as dkh points out the line which the compiler complains about is seldom the actual culprit.  For example, In you case, the closing brace "}" on line 55 is probably correct and the problem is that you are missing an opening brace on a prior line.   For this reason it is important to keep a good discipline of indenting code blocks.

There is a nifty feature in the script editor that allows you to find matching braces.  Simply place the cursor just befor the opening brace and press ctrl-B and the cursor will be positioned over the matching closing brace.

Review your code from the beginning of the global script to see where you are missing an opening brace.  You are missing one somewhere befor line 55 where the error occurs.  If you can't find it post the first 55 lines of your global script here.  Use the [ pre ],[ /pre ] tags when posting.

MissyChelle

Ok so I took you guys' advice and it worked! :D thank you very much! But...when I did that another error popped up. This time it says:

Error (line 64): Undefined token 'show_inventory_window'

wow...I'm so bad at this this. I'm so sorry.
~*MissyChelle*~

MissyChelle

N/M I figured it out! :D I can't believe I figured it out on my own! lol.
~*MissyChelle*~

SMF spam blocked by CleanTalk