Freddy1990
2006-05-24 01:46:19
Ok, it has come to my attention that we don't use scar at it's full potential, so for those who don't know, here's a lesson.
Most of you have propably already heard about the TPoint sometime…
It is a variable that can contain an X and Y value.
Now, we can make our own variable types!
Most propably dunno this so watch carefully…
It works somewhat as defining variables…
You have ur script:
It has to be done like this:
And finally we can create closed arrays:
Now, this is just a part of the possibilitys, but i hoped everyone who read this learned something…
Most of you have propably already heard about the TPoint sometime…
It is a variable that can contain an X and Y value.
Now, we can make our own variable types!
Most propably dunno this so watch carefully…
It works somewhat as defining variables…
You have ur script:
program New;
begin
end.Now we can add underneath program "var …" but in this case we are going to add "type":program New;
type
begin
end.Now we will create a variable with X1, Y1, X2, Y2. We'll call it TBox.It has to be done like this:
program New;
type
TBox = record
X1, Y1, X2, Y2: Integer;
end;
begin
end.Now what if we want to use an array of our variable? Well you could write "array of TBox" every time, but you can do it another way as well, We create a TBoxArray like this:program New;
type
TBox = record
X1, Y1, X2, Y2: Integer;
end;
TBoxArray = array of TBox;
begin
end.And finally we can create closed arrays:
program New;
type
TBox = record
X1, Y1, X2, Y2: Integer;
end;
TBoxArray = array of TBox;
TBoxClosedArray = array[1..5] of Integer;
begin
end.Now, this is just a part of the possibilitys, but i hoped everyone who read this learned something…