User Tools

Site Tools


line_draw_a_straight_line_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== LINE (draw a straight line) ====== Previous pageReturn to chapter overviewNext page

LINE( x ,y ,width ,height [,attributelist])

blk2blue.jpg

LINE Draws a straight line on the current window or report.
X An integer expression specifying the horizontal position of the starting point.
Y An integer expression specifying the vertical position of the starting point.
Width An integer expression specifying the width. This may be a negative number.
Height An integer expression specifying the height. This may be a negative number.
attributelist A string constant, variable, or EQUATE containing an optional type of output document and its associated attributes. Only valid when the target is a REPORT. See EXTEND

The LINE procedure places a straight line on the current window or report. This procedure is valid in Clarion Win32 Windows, and also for REPORT structures in both Clarion Win32 and Clarion#.

The starting position, slope, and length of the line are specified by x, y, width, and height parameters. The x and y parameters specify the starting point of the line. The width and height parameters specify the horizontal and vertical distance to the end point of the line. If these are both positive numbers, the line slopes to the right and down from its starting point. If the width parameter is negative, the line slopes left; if the height parameter is negative, the line slopes left. If either the width or height parameter is zero, the line is horizontal or vertical.

Width     Height   Result

positive  positive  right and down from start point

negative  positive  left and down from start point

positive  negative  right and up from start point

negative  negative  left and up from start point

zero      positive  vertical, down from start point

zero      negative  vertical, up from start point

positive  zero      horizontal, right from start point

negative  zero      horizontal, left from start point

The line color is the current pen color set by SETPENCOLOR; the default color is the Windows system color for window text. The width is the current width set by SETPENWIDTH; the default width is one pixel. The line's style is the current pen style set by SETPENSTYLE; the default style is a solid line.

Example:

MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL

        !window controls

        END

CODE

OPEN(MDIChild)

LINE(100,50,100,50)    !Draw line

See Also:

Current Target

SETPENCOLOR

SETPENWIDTH

SETPENSTYLE

line_draw_a_straight_line_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1