Syntax error?

krainert

Member
Reaction score
10
vJass:

JASS:
library OptionalCode //simplified from example at <a href="http://www.wc3c.net/vexorian/jasshelpermanual.html" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://www.wc3c.net/vexorian/jasshelpermanual.html</a>
    globals
        constant boolean DO_KILL_LIB = true
    endglobals
    function fun takes nothing returns nothing
        static if DO_KILL_LIB then //*
            call BJDebugMsg(&quot;DO_KILL_LIB is true&quot;)
        endif
    endfunction
endlibrary


Syntax error at the asterisk (*). What am I missing?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
im not experienced with static ifs, but wouldnt it work the same if you just used an [ljass]if DO_KILL_LIB then[/ljass]?
 

Dirac

22710180
Reaction score
147
GFreak45 please stop answering if you don't know the answer O_O

Yes it would work if the [ljass]if[/ljass] weren't [ljass]static[/ljass], but obviously kraniert needs a it for something else

Btw i copy pasted it into my map and compiles, are you running on the latest JassHelper version?
 

dudeim

New Member
Reaction score
22
It probably somehow reads it as a comment block
JASS:

/*
this is also a comment I think somehow jasshelper misses that the &quot;*&quot; is commented and tries to find a comment block end but as there is none it gives an error
just put this: &quot;*./&quot; at the end try if it works (remove the dot).
*/
 

luorax

Invasion in Duskwood
Reaction score
67
You can't nest comments, and JH think you're doing that. Get rid of the (*), try to add another (/) or try to close it with (*/). Some of these might work.

Or try to update your JH to 0.A.2.B., because Dirac said it works with his JH.
 

krainert

Member
Reaction score
10
GFreak45 please stop answering if you don't know the answer O_O
Chill, dude :)

im not experienced with static ifs, but wouldnt it work the same if you just used an [ljass]if DO_KILL_LIB then[/ljass]?
http://www.wc3c.net/vexorian/jasshelpermanual.html said:
static ifs are like normal ifs, except that a) the condition must contain only constant booleans, the and operator and the not operator and b) They are evaluated during compile time. Which means that the code that is not matched to its condition is simply ignored.

Btw i copy pasted it into my map and compiles, are you running on the latest JassHelper version?
Figures. I'll try it on this (another) pc.

It probably somehow reads it as a comment block
JASS:
/*
this is also a comment I think somehow jasshelper misses that the &quot;*&quot; is commented and tries to find a comment block end but as there is none it gives an error
just put this: &quot;*./&quot; at the end try if it works (remove the dot).
*/
I'm not entirely sure I follow, but I'll look at it.

Thanks.
 

krainert

Member
Reaction score
10
Okay, it works on my desktop pc which explains why I did not encounter any errors the last time I tested the map.

NewGen WE has occasionally been crashing on launch on my laptop, on which the syntax error issue occurred, and now it seems I run into this problem on every single launch for some reason.
Any ideas? It's a brand new Win7 x64 Pro installation, and I just downloaded the Jass NewGen Pack anew just to be safe. No success so far.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
GFreak45 please stop answering if you don't know the answer O_O

im trying to learn, is there anything wrong with that?
my questions just come up in other threads
thats how i learned gui, data editing in sc2 and plenty of other things
so if you dont like it, thats great for you, but dont tell me because i honestly dont care
 

krainert

Member
Reaction score
10
But I figure its editor should still be able to launch at least... Anyway, how do you recommend I acquire a contemporary WE distro with JassHelper?
 

Dirac

22710180
Reaction score
147
@luorax
JASS:
//* this doesn&#039;t cause JH to think you&#039;re trying to nest comments since that makes no sense at all
/* /* /* neither does this */
//////// or this

@dudeim
Wrong, the double slash means that everything in that line is a comment therefore the (*) is ignored
@GFreak45
Thats one sweet way to hijack threads then, if you have any questions bring them up yourself in a new thread
 

dudeim

New Member
Reaction score
22
@luorax
JASS:
//* this doesn&#039;t cause JH to think you&#039;re trying to nest comments since that makes no sense at all
/* /* /* neither does this */
//////// or this

@dudeim
Wrong, the double slash means that everything in that line is a comment therefore the (*) is ignored
@GFreak45
Thats one sweet way to hijack threads then, if you have any questions bring them up yourself in a new thread

I know it shouldn't be counted but who knows maybe some bug in JH or an outdated version bugs with it you never know;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top