
WayneA
USA
Asked
— Edited
Good Afternoon.
I want to create an array where I store two string values. For this example I will call it $x and $y. I want to store the variables in the array. I want to store as many as I need. I understand the definearray command. What I do not understand is how to input in the array and keep adding the string variables. Let me post my example.
#Example Array
$x = GetRandomUnique(1,50)
$y = GetRandomUnique(1,100)
DefineArray($z,2)
#when I do this...
$x = $z[0]
$y = $z[1]
#the variables z0 and z1 stay the same everytime i run the script.
I have two coding sugestions
1 remove the defarray statement out of the main loop of code and only issue the statement once in your code initialization at the startup before storing any values in the array.
2 you need a counter that increments 100 times and use that counters current value as the pointer to which value in the array you want to save or read