Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dealing with rectangles in Delphi 1

Status
Not open for further replies.

Froskoy

Programmer
Jul 25, 2009
18
0
0
GB
Hi,

I have a series of rectangles on a form as follows:

rec0801 rec0802 rec0804 rec0805 ....... rec0824
.
.
.
.
rec0201 rec0202 rec0203 rec0204 ....... rec0224
rec0101 rec0102 rec0103 rec0104 ....... rec0124

A bit like pixels.

I need to manipulate these rectangles every time a timer iterates.

The long and messy way of doing this, which I don't much like, is to set a count variable and increment is as following.

Code:
procedure tmrIterate.....;
begin
 if Count=1 then rec0101.Brush.Color:=.....
 if Count=2 then rec0102.Brush.Color:=.....
 e.t.c.
 Count:=Count+1;
end;

I'd rather do this with a repeat.... until loop a bit like the following. Excuse my syntax for this, I am trying to get over the type of thing I am trying to do:

Code:
procedure tmrIterate.....;
begin
repeat
 rec[x][y].Brush.Color:=.....
 Count:=Count+1;
until Count:=192;
end;

What is the syntax for doing something like this? Is it possible? Do I have to create the rectangles differently?

Using Borland Delphi 4.

Thank you very much,

Froskoy.
 
Would something like this help?

thread102-1465638

Measurement is not management.
 
Yes! That helps immensely.

Thank you very much for that. I like the structure and posts on this forum. I think I'll be coming back for more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top