Difference between revisions of "AddDTM"

From SCAR Divi Manual
Jump to: navigation, search
(Description)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
<func>function AddDTM(DTM: TDTM): Integer;</func>
+
<source lang="scar" lines="false">
 +
function AddDTM(DTM: TDTM): Integer;
 +
</source>
  
 
==Availability==
 
==Availability==
Line 6: Line 8:
  
 
==Description==
 
==Description==
This function adds a "dynamic [[DTM]]" '''DTM''' defined by a [[TDTM]] structure to the DTM resource system, after which it can be used to by every [[:Category:DTM Functions|DTM related function]]. The function returns the index of the newly created DTM in the DTM resource system. It will be automatically freed if the script stops and you have not freed it yourself with [[FreeDTM]].
+
Adds a "dynamic [[DTM]]" '''DTM''' defined by a [[TDTM]] structure to the DTM resource system, after which it can be used to by every [[:Category:DTM Functions|DTM related function]]. The function returns the index of the newly created DTM in the DTM resource system. It will be automatically freed if the script stops and you have not freed it yourself with [[FreeDTM]].
  
 
==Example==
 
==Example==

Latest revision as of 12:59, 1 July 2011

Definition

function AddDTM(DTM: TDTM): Integer;

Availability

SCAR Divi 3.00 > Current

Description

Adds a "dynamic DTM" DTM defined by a TDTM structure to the DTM resource system, after which it can be used to by every DTM related function. The function returns the index of the newly created DTM in the DTM resource system. It will be automatically freed if the script stops and you have not freed it yourself with FreeDTM.

Example

var
  DTM: TDTM;
begin
  DTM.MainPoint.x := 5;
  DTM.MainPoint.y := 5;
  DTM.MainPoint.areashape := shpRectangle;
  DTM.MainPoint.tolerance := 1;
  DTM.MainPoint.color := 123456;
  DTM.MainPoint.areasize := 4;
  SetLength(DTM.SubPoints, 1);
  DTM.SubPoints[0].x := 9;
  DTM.SubPoints[0].y := 7;
  DTM.SubPoints[0].areashape := shpRectangle;
  DTM.SubPoints[0].tolerance := 8;
  DTM.SubPoints[0].color := 654321;
  DTM.SubPoints[0].areasize := 2;
  WriteLn(AddDTM(DTM));
end.

Output:

0

See Also