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

[JASS] 2 quick questions

Status
Not open for further replies.
Level 8
Joined
Aug 4, 2006
Messages
357
1. In functions, can arrays be used as parameters or returned? both function func takes integer array arr returns nothing and function func2 takes nothing returns integer array give me the error
Code:
Expected: "returns"
I know one solution to this is to put the array in a wrapper struct, and pass the struct, but i just want to make sure there is no other way to do it.

2. Structs can contain arrays with the limitation that the arrays have a certain size (i.e. 20 elements). This limits the number of instances the struct can have from 8190 to 8190/array size (i.e. 409 instances). This is due to the fact that each "array" in a struct instance is just a section of a 8190 element array used by the entire struct.
JASS:
struct stuff //max instance count of 409
    integer array crap{20} //mentally replace {} with []
endstruct
vJass allows you to make sized arrays greater than 8190 elements (through the use of extra arrays). Is there a way to use this feature to increase the max instance count of a struct containing an array?
 
Status
Not open for further replies.
Top