• 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.

vJass: where to create struct?

Status
Not open for further replies.
Level 7
Joined
Jan 30, 2011
Messages
267
don't know if this question sounds stupid but where to write this:
JASS:
struct Test
endstruct
i tried to put it into the head, but compiler said: "Statement outside of function"
pls help
 
Level 7
Joined
Jan 30, 2011
Messages
267
i wrote your exact code into maphead and compiler said: "Syntax error" and "Statement out of function" right in the first line (i'm using vJass)

Edit: i just found out that i can save the map without any error message, but if i click "syntax check", then it complains
 
Last edited by a moderator:
Level 26
Joined
Aug 18, 2009
Messages
4,097
Structs can be declared outside of scopes if not flagged as public/private (which is not the case here). Have you used the Syntax Check function or tried to save the map? First is only meant for normal jass or so, it does not matter. Else look out for unfinished function declarations (missing endfunction) and the like.
 
Level 7
Joined
Jan 30, 2011
Messages
267
as mentioned in the EDIT: of my last comment, i can save the map without problems, only the syntax check complains
 
That is the syntax checker of TESH. (Trigger Editor Syntax Highlighting) It checks for errors that would occur when running it under the standard World Editor syntax checker, not the Jass NewGenPack syntax checker.

So basically, ignore the syntax checker that TESH has, only pay attention to the errors that are brought up when you try to save the map, as those are the only actual errors in the code. (in terms of vJASS)
 
Status
Not open for further replies.
Top