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.
$x = GetRandomUnique(1,50)
$y = GetRandomUnique(1,100)
#when I do this...
$x = $z
$y = $z
#the variables z0 and z1 stay the same everytime i run the script.
Upgrade to ARC Pro
Synthiam ARC Pro is a cool new tool that will help unleash your creativity with programming robots in just seconds!
Are you sure you have it as above?
$variable = "Contents of variable"
So putting $x = $z will cause $x to be the same as what $z is, not the other way around.
Putting the variables around the correct way will solve the problem.
$z and $z wouldn't change if you use AppendArray()
To repeat it 100 times could be done a number of ways, the easiest is with a counter and a repeatuntil()
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