• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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