Global data?

Dirac

22710180
Reaction score
147
hi i was just wondering why does my jasshelper keeps finding an syntax error in this code
JASS:
globals
     private data array DATA
endglobals

do i need to apply a system to my map in order for this to work?
 

emjlr3

Change can be a good thing
Reaction score
395
what is data?

is it established as a variable type prior to your global deceleration?
 

Dirac

22710180
Reaction score
147
it should be a variable able to store struct data as in
JASS:
local structname A
set DATA[1] = A


EDIT: nvm i just figured it out, i have to use a keyword. However im still wondering, why isnt there a variable type able to store struct indexing
 

Rllulium

New Member
Reaction score
10
it should be a variable able to store struct data as in
JASS:
local structname A
set DATA[1] = A


EDIT: nvm i just figured it out, i have to use a keyword. However im still wondering, why isnt there a variable type able to store struct indexing
Struct indexes are integers. (A struct compiles to an array)
 

Sevion

The DIY Ninja
Reaction score
413
If you need an array of structs do the following:

JASS:
struct myStruct extends array
    implement Alloc // My more efficient allocation and deallocation method that can be found in the Resource Submissions

    // Your stuff here
endstruct

// You can now do things like myStruct data = myStruct.allocate(), data[1].data = 581
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top