- Joined
- Aug 4, 2006
- Messages
- 357
1. In functions, can arrays be used as parameters or returned? both
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.
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?
function func takes integer array arr returns nothing
and function func2 takes nothing returns integer array
give me the error
Code:
Expected: "returns"
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