This function gives you a reference to the object located at either the mouse position or a specified position. The way you specify positions, however, is fairly ridiculous.
uObject = SYS( 1270 [, nXCoord, nYCoord ] )|
Parameter |
Value |
Meaning |
|
nXCoord, nYCoord |
Numeric |
The position for which you want an object reference. |
|
Omitted |
Return a reference to the object under the mouse pointer. |
|
|
uObject |
Object |
A reference to the object at the current or specified position. |
|
.F. |
No object was found at the current or specified position. |
SYS(1270) is a lot like ASELOBJ(), except that it doesn't require you to actually click on anything—you can just grab whatever's under the mouse pointer. Like so many SYS() Functions before it, once Microsoft realized that this one is really useful, in VFP 6 they gave us a new and improved version—check out AMouseObj().
If you omit the parameters, this function works as advertised. It gives you a reference to the object the mouse is over. This is especially handy for debugging.
We're also baffled as to why the function has two different return types. Why not return .NULL. when there's no object there? Having an object reference in one case and .F. in the other makes it a pain to write code that uses the function. We have to check VARTYPE() of the return value before we do anything.
oCurrent = SYS(1270)
* A lot of people set up something like this to make debugging
* easier. The second line is needed so forms will close.
ON KEY LABEL F11 o = SYS(1270)
ON KEY LABEL F12 o = .null.