Struct extends array?

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i tried to use Struct extends array like it shows in the JassHelper Manual but it keeps giving me a syntax error

can anybody tell me how use it?
 

Romek

Super Moderator
Reaction score
963
You cannot use .create, .allocate or .destroy on a struct that extends an array.

Instead, you directly set the values like as if the structs were arrays.
JASS:
struct ABC extends array
   integer i
   unit u
endstruct

//
set ABC[5].i = 3
set ABC[543].i = 6
set ABC[3].u = GetTriggerUnit()

This can be useful in loops and such.
 

Builder Bob

Live free or don't
Reaction score
249
Your code compiles for me. I'm using JassHelper 0.9.E.0 if it matters. (I'm updating it when I feel like it)
 

Romek

Super Moderator
Reaction score
963
Make sure you update your Jasshelper.
Click
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
hmm i downloaded it but how do i implament it in my JassNewGen?
 

Romek

Super Moderator
Reaction score
963
Your Newgen Folder -> JassHelper
Replace the old executable with the new one.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i replaced and the error still shows up
could you upload me your NewJassGen with the updated Jass Helper?
 

Romek

Super Moderator
Reaction score
963
Why would I upload the entire pack, if all you need to do is replace the *.exe file?

Try restarting WE, and make sure you're using the correct World Editor.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top