• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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
 
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:
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.
 
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.
Back
Top