princesssparkle2010
Member
- Joined
- May 5, 2021
- RedCents
- 50¢
Is it possible to make a multidimentional array in a macro ?? I don't know Lua.. and i need to be able to create a multidimental array.
Basicly.. I have a routine that pulls back 5 numbers.. and associates each number with a string value... once i run the values through a loop to get the lowest number.. i need to return the associated string value for that array item...
So.. like this:
array slot --- value --- String
1 ---- 142 ---- Head
2 ---- 221 ---- Feet
3 ---- 65 ---- Arms
4 ---- 76 ---- Chest
5 ---- 9 ---- Neck
Once i run through the loop to pull back the LOWEST number valuer for the list set of the array value ( 142/221/65/76/9 ) .. it returns back 9 ... correctly.. but i need set the STRING value associated with the array slot for value 9 ... ( NECK )
Is this doable??
I know how to setup a 2 dimentional array and pull back a value... but not 3....
Basicly.. I have a routine that pulls back 5 numbers.. and associates each number with a string value... once i run the values through a loop to get the lowest number.. i need to return the associated string value for that array item...
So.. like this:
array slot --- value --- String
1 ---- 142 ---- Head
2 ---- 221 ---- Feet
3 ---- 65 ---- Arms
4 ---- 76 ---- Chest
5 ---- 9 ---- Neck
Once i run through the loop to pull back the LOWEST number valuer for the list set of the array value ( 142/221/65/76/9 ) .. it returns back 9 ... correctly.. but i need set the STRING value associated with the array slot for value 9 ... ( NECK )
Is this doable??
I know how to setup a 2 dimentional array and pull back a value... but not 3....
INI:
/declare x int local
/declare myArray[5] int local
/varset myArray[1] ${Guk_WinsToGo}
/varset myArray[2] ${Miragul_WinsToGo}
/varset myArray[3] ${Mistmoore_WinsToGo}
/varset myArray[4] ${Ruj_WinsToGo}
/varset myArray[5] ${Tak_WinsToGo}
|set a default value for the greatestNumber, the first entry in the array works well
/declare greatestNumber int local ${myArray[1]}
|start at 2 since we already have the first value loaded, no reason to compare it to itself.
/for x 2 to ${myArray.Size}
|if myArray[x] is lower than the currently set lowest number
/if (${myArray[${x}]} > ${greatestNumber}) {
|set the lowest number to myArray[x]
/varset greatestNumber ${myArray[${x}]}
}
/next x