Ever wanted to make those neat arrays that no one, but yourself understand?
Well I like to make them often and very advanced..
Here I will suggest that you have read Kanes tutorial on arrays before starting, because I will not teach you arrays from the start
PHP Code:
var
myArray: Array of Array of Array of Integer;
That's the kind of arrays I will teach you to use today..
You might ask yourself, what could I use those arrays for? They just seem to be a lot of work..
I found use of them several times, let me give you my latest example:
PHP Code:
var
aPoints: Array[0..2]of TPointArray;
begin
for aCount := 0 to 2 do
begin
FindColorsTolerance(aPoints[aCount], color,1, 1, 515, 336, 10);
Wait(50);
end;
for aCount := 0 to 2 do
for bCount := 0 to GetArrayLength(aPoint[aCount]) - 1 do
This script will find all the colors 3 times, and then loop through them all, perhaps you could make a gas solver out of this..
I know that StarBlaster also uses multidimensional arrays in his Essense miner...
Simple as it sounds, when you want to make a multidimensional you just define an array of an array..
and when you want to get info from it you make two boxes:
PHP Code:
var
myArray: Array of Array of String;
myString: String;
begin
myString := 'IOWN';
SetArrayLength(myArray, 1);
for aCount := 0 to Length(myString) - 1 do
begin
SetArrayLength(myArray[0], aCount + 1);
Array[0][aCount] := myString.aCount;
end;
and so on and so on..
Can someone say autoresponder?
I see the use of multi dimensional arrays everywhere, but don't overdo it... you need to understand it yourself
I hope you found it usefull, if you didn't then you aren't ready to learn the secrets of multi dimensional arrays..