Stevee
2010-03-15 12:57:07
Yes, I've read all the tutorials.
1. So a TPA (TpoinArray) is an array of x's and y's. Correct?
5. In this small script from n3ss3s tutorial; [BANANA]
1. So a TPA (TpoinArray) is an array of x's and y's. Correct?
TPA[[COLOR=#000080]0[/COLOR]] := IntToPoint([COLOR=#000080]10[/COLOR], [COLOR=#000080]5[/COLOR]);
2. That's how a Tpoint is set. I can set TPA[1..XXX] like this too?
3. How many points are there in the standard TPA? Are they automatically created? Do I need SetArrayLength?
[code] [COLOR=#000000][B]For[/B][/COLOR] I := [COLOR=#000080]0[/COLOR] [COLOR=#000000][B]To[/B][/COLOR] High(TPA) [COLOR=#000000][B]Do[/B][/COLOR] [COLOR=#008000]// High = highest slot[/COLOR]
4.Is High(TPA) the highest declared numbered array? For instance, if I declared TPA[5], would the High(TPA) be 5?5. In this small script from n3ss3s tutorial; [BANANA]
[COLOR=#000000][B]Procedure[/B][/COLOR] TPAMouseExample;
[COLOR=#000000][B]Var[/B][/COLOR]
TPA: TPointArray;
I, C: Integer;
[COLOR=#000000][B]Begin[/B][/COLOR]
SetArrayLength(TPA, [COLOR=#000080]10[/COLOR]);
[COLOR=#000000][B]For[/B][/COLOR] I := [COLOR=#000080]0[/COLOR] [COLOR=#000000][B]To[/B][/COLOR] High(TPA) [COLOR=#000000][B]Do[/B][/COLOR] [COLOR=#008000]// High = highest slot[/COLOR]
[COLOR=#000000][B]Begin[/B][/COLOR]
TPA[i].x := (i + [COLOR=#000080]1[/COLOR]) * [COLOR=#000080]10[/COLOR];
TPA[i].y := (i + [COLOR=#000080]1[/COLOR]) * [COLOR=#000080]20[/COLOR];
[COLOR=#000000][B]End;[/B][/COLOR]
[COLOR=#008000]// Now, we go through with it using mouse, watch...[/COLOR]
[COLOR=#000000][B]For[/B][/COLOR] C := [COLOR=#000080]0[/COLOR] [COLOR=#000000][B]To[/B][/COLOR] High(TPA) [COLOR=#000000][B]Do[/B][/COLOR]
[COLOR=#000000][B]Begin[/B][/COLOR]
MoveMouse(TPA[c].x, TPA[c].y);
Wait([COLOR=#000080]250[/COLOR]);
[COLOR=#000000][B]End;[/B][/COLOR]
[COLOR=#000000][B]End[/B][/COLOR];[/BANANA] how come i is never declared?