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:
Now we can add underneath program "var ..." but in this case we are going to add "type":Code:program New; begin end.
Now we will create a variable with X1, Y1, X2, Y2. We'll call it TBox.Code:program New; type begin end.
It has to be done like this:
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:Code:program New; type TBox = record X1, Y1, X2, Y2: Integer; end; begin end.
And finally we can create closed arrays:Code:program New; type TBox = record X1, Y1, X2, Y2: Integer; end; TBoxArray = array of TBox; begin end.
Now, this is just a part of the possibilitys, but i hoped everyone who read this learned something...Code:program New; type TBox = record X1, Y1, X2, Y2: Integer; end; TBoxArray = array of TBox; TBoxClosedArray = array[1..5] of Integer; begin end.








Reply With Quote

good read!
Sorry.
