version 6.0
DR Draw line (area; startH; startV; endH; endV; mode) Longint
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| startH | Number | Horizontal position of start | |
| startV | Number | Vertical position of start | |
| endH | Number | Horizontal position of end | |
| endV | Number | Vertical position of end | |
| mode | Integer | 0=Absolute | |
| 1=Relative | |||
| Function result | Longint | Object ID |
Description
The command DR Draw line creates a new line in area and returns the object's ID.
The new line is created with the default line attributes and positioned according to startH, startV, endH, and endV. All four coordinates are expressed in base units. Use the DR Scale to base function to convert from scale units to base units.
startH and startV are specified as offsets from the current origin.
endH and endV can be specified as offsets from the current origin (absolute) or offsets from startH and startV (relative).
If mode equals 0, endH and endV are absolute coordinates. If mode equals 1, endH and endV are relative coordinates. Positive values indicate a direction down or right. Negative values indicate a direction up or left.
Examples
(1) The following example uses DR Draw line with absolute coordinates. It sets the origin to the upper left corner of the document and then draws a line that starts one in/one down and ends two in/two down.
DR SET ORIGIN (Area;0;0;0) $ID := DR Draw line (Area;1;1;2;2;0)
(2) The following example uses DR Draw line with relative coordinates. It draws a line that starts at the current origin and ends three base units to the right.
$ID := DR Draw line (Area;0;0;3;0;1)
See Also
DR SET ENDMARKS, DR SET LINE ATTRIBUTES.