CurrentX, CurrentY Properties

Purpose

Returns or sets the horizontal (CurrentX) or vertical (CurrentY) coordinates for the next drawing method.

Syntax

[Object.]CurrentX [= value ]

[Object.]CurrentY [ = value]

Object:Form or Printer object
value: Single expression

Description

Coordinates are measured from the upper-left corner of an object. The CurrentX property setting is 0 at an object's left edge, and the CurrentY property setting is 0 at its top edge. Coordinates are expressed in pixels, or the current unit of measurement defined by the ScaleHeight, ScaleWidth, ScaleLeft, ScaleTop, and ScaleMode properties.

When you use the following graphics methods, the CurrentX and CurrentY settings are changed as indicated:

[P]Circle The center of the object.
[P]Box The right bottom corner of the object.
[Gray]Text The right bottom corner of the text.
Cls 0, 0.
Draw/Line The end point of the line.
Point/Pset The point drawn.
EndDoc 0, 0
NewPage 0, 0
[L]Print The next print position

Example

OpenW 1

Local a%, xx, yy

Win_1.CurrentX = 150

Win_1.CurrentY = 50

xx = CurrentX

yy = CurrentY

Text CurrentX, CurrentY, "Press any key"

KeyGet a%

Cls

Text xx, yy, "GFA"

Circle 100, 100, 50

Text CurrentX, CurrentY, "X"

Do : Sleep : Until Me Is Nothing

Remarks

Usually, CurrentX and CurrentY are use with an object, like Me.CurrentX, or Printer.CurrentX. Without an object, the current Output device is used.

See Also

Output, Form, Printer

{Created by Sjouke Hamstra; Last updated: 27/09/2014 by James Gaite}