On 01/06/2016 13:55, Wayne Yeung wrote:
Greetings, I have an old app with forms created using Define Window. Textboxes are created by @ Get. I know many of you will tell me to upgrade which I'm doing but I still need to support the existing app.
Well, here is my question: What is be best way to mimic Setfocus() for a @ Get control? Is this even possible without using the valid clause? My goal is to centralize validation in one place before saving to the dbf.
What you need is _CUROBJ = <expn>
From the help file:
_CUROBJ Example
The following program example demonstrates how GET objects are numbered and how _CUROBJ can be used to return the object number of the current object. Press Tab or the arrow keys to select different objects. Pressing F2 displays the object number for the current object.
CLEAR SET TALK OFF STORE 1 to x, y, z ON KEY LABEL F2 @ 12,2 SAY 'Object # ' + STR(_CUROBJ) && Show # @ 4,2 GET x PICTURE '@*R <Apples;<Oranges;<Limes' && Radio @ 2,2 GET y && Get field @ 8,2 GET z PICTURE '@^ <Pears;<Bananas;<Pineapples' && Popup READ CYCLE ON KEY LABEL F2 && Reset F2 key to default SET TALK ON
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960