• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Can't figure out compiling error

Status
Not open for further replies.
Level 8
Joined
Aug 2, 2006
Messages
346
I have a function that I'm calling from an if statement.

if getScoreType() then...

the function getScoreType() returns a boolean value.

Whenever I try to save, it keeps telling me it is 'expecting a name'. (well I'm glad they were so specific...)

EDIT: Ah figured it out. getScoreType() was declared after it was called.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
  • Is getScoreType() above the function which is trying to call it?
  • Is the capitalisation right?
  • Are you sure it's even that line causing the problem?

Post the entire function(s).

@Donut, wrong, ifs compare to try implicitly (or else they couldn't work anyways!)

How else would you write if x > 5 then, for example?
 
Level 8
Joined
Aug 2, 2006
Messages
346
I figured out the problem! (and this WAS actually supposed to be the second post in this thread, but it didn't take for some reason).

I was declaring the function being called AFTER it was called, and that ain't right!
 
Status
Not open for further replies.
Top