HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Expected a name compile error

01-04-2005, 07:02 AM#1
overdrive
What can one do to get an "Expected a name" compile error? The fact that the WorldEdit compiler doesn't mark where the errors are within the line of code (like the Java compiler) is very irritating.

Say, for example, I have a custom function on the lines of this:
Code:
function foo takes integer x returns string


Then somewhere else (in a different trigger), I have the line:
Code:
call DisplayTextToForce( GetPlayersAll(), foo(10) )


However, when I compile/save the code, I get an "Expected a name" error. How would I fix it?
01-04-2005, 05:46 PM#2
curi
did u make sure u defined ur function above where u use it?
01-04-2005, 10:01 PM#3
AIAndy
The World Editor often marks the wrong line.
01-07-2005, 10:21 PM#4
overdrive
I figured it out with the help of curi's comment. I tried placing my function inside the trigger that calls the function and it works perfectly fine now.

Thanks for your help.
01-07-2005, 11:22 PM#5
ProFeT
The function that is called must be written BEFORE the calling function. :\