SRL Archive - SRL Archives

Function CreateDDTM(...) : TDTM;


Dark_Sniper

2007-10-09 20:23:05

Well Rs monkey did tip me off with setarraylength…

simple to use and easy to make a ddtm…

Function CreateDDTM(PointX, PointY, PointAreaSize, PointAreaShape, PointColor, PointTolerance : TIntegerArray) : TDTM;
var
b : Integer;
DDTM : TDTMPointDefArray;
MainDDTM : TDTMPointDef;
DDTMSkel : TDTM;
begin
MainDDTM.x:=PointX[0];
MainDDTM.y:=Pointy[0];
MainDDTM.areasize:=Pointareasize[0];
MainDDTM.areashape:=Pointareashape[0];
MainDDTM.color:=Pointcolor[0];
MainDDTM.tolerance:=Pointtolerance[0];
setarraylength(DDTM, (GetArrayLength(PointX)-1))
for b := 1 to (GetArrayLength(pointX)-1) do
begin
DDTM[b-1].x:=PointX[b];
DDTM[b-1].y:=Pointy[b];
DDTM[b-1].areasize:=PointAreaSize[b];
DDTM[b-1].areashape:=PointAreaShape[b];
DDTM[b-1].color:=PointColor[b];
DDTM[b-1].tolerance:=PointTolerance[b];
end;
DDTMSkel.MainPoint:=MainDDTM;
DDTMSkel.SubPoints:=DDTM;
Result:=DDTMSkel;
end;

usage:

YourDTM:=AddDtm(CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3]));
it automatically assumes the first set of inputs for the var is your main point.

everything after that is subpoints.


i have tested this and it works.

actully pretty fun to use :p
you should give it a go.:garfield:




Summary:

basically it is a shorter + takes up less lines DDTM declarement.

if you don't understand that it is
its a way to make ddtms with out all the hassle of diffrent vars and space taking way of making a ddtm.(check usage)


Understanding usage:
usage:

YourDTM:=AddDtm(CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3]));

lets break it down to CreateDDTM.
Function CreateDDTM(PointX, PointY, PointAreaSize, PointAreaShape, PointColor, PointTolerance : TIntegerArray) : TDTM;

PointX - the X value for a DDTM
PointY - the Y value for a DDTM
PointAreaSize - how big of an area can this color be in ( 3-4 max)
pointAreaShape - leave at 0 for default.
PointColor - color value for that point.
PointTolerance - tolerance for the pointcolor


createddtm will make the ddtm and return it to its result.
so now createddtm(…) will be the ddtm.

now you need a reg var declare as integer.
and just follow the usage and it will save the ddtm to that var.

and from there all you have to do is use the var like it has a dtm declared in it.

FindDTM(Var,….)

note:

it automatically assumes the first set of inputs for the var is your main point.

everything after that is subpoints.

this means
CreateDDTM([432, 426, 430], [65, 68, 64], [1, 1, 1], [0, 0, 0], [5000447, 14145495, 15198183], [3, 3, 3])

makes the main point of the ddtm
everything after is the subpoint :)


enjoy :p

Town

2007-10-09 21:09:44

Starblaster made http://www.villavu.com/forum/showthread.php?t=10338, if that's what you mean.

Dark_Sniper

2007-10-09 21:33:47

ahh ok thought he made something more like this …mines diffrent :p

:sasmokin:

pwnaz0r

2007-10-09 21:40:59

I also had one.

http://www.villavu.com/forum/showthread.php?t=17512

Dark_Sniper

2007-10-09 21:46:25

lol i see :p

mine gives you more options :p
also mine does not automatically save the ddtm to a var…. you have to manually add the dtm(which means you get to name it)… check usage :p

stars and yours just does items though :p


mine does not get limited there. :p

danrox2004

2007-10-11 04:56:30

I also made one.. I will see if i can find it.

mastaraymond

2007-10-11 10:41:22

http://www.villavu.com/forum/showthread.php?t=13306

Yeah i made one to ^^.

Dark_Sniper

2007-10-11 12:18:33

I never found any so I made one :p.

ShowerThoughts

2007-10-11 12:21:08

bad searcher ;) and stop using :p:p:p:p:p:p:p:p:p
i almost got the cup so stop doing that :p

mastaraymond

2007-10-11 12:24:18

From: Dark_Sniper
I never found any so I made one :p.
Need private search lessons? You can always call me!

Markus

2007-10-11 13:40:49

From: mastaraymond
Need private search lessons? You can always call me!


I wanna have private search lessons :p

mat_de_b

2007-10-11 14:03:54

I made one too….

Dark_Sniper

2007-10-11 16:11:05

lol to everyone who said they made one too :p


lemme state the obvious to you :p


I MADE ONE AS WELL!



so haha :p

and I can stop using :p

it comes natural now :p

all thanks to my mom teaching me this smiley :p when i was like 6-7 :p

and if i dont post :p after my sentence it makes people think im being serious and on the internet im hardly ever serious.

Santa_Clause

2007-10-12 23:52:45

Why does everyone say it as if it's the hardest ever function to make :p