Index
2016-06-01 07:55 – Wayne Yeung : Need GetFocus() for FP 2.6 @Get.
2016-06-01 08:16 – Peter Cushing : Re: Need GetFocus() for FP 2.6 @Get.
2016-06-01 08:52 – Wayne Yeung : Re: Need GetFocus() for FP 2.6 @Get.
2016-06-01 09:04 – Peter Cushing : Re: Need GetFocus() for FP 2.6 @Get.
2016-06-01 09:06 – Jean MAURICE : Re: Need GetFocus() for FP 2.6 @Get.
2016-06-01 10:04 – Wayne Yeung : Re: Need GetFocus() for FP 2.6 @Get.
Back to top
Need GetFocus() for FP 2.6 @Get.

Author: Wayne Yeung

Posted: 2016-06-01 07:55:39   Link

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.

Thanks,

Wayne

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAJDnZHfCKgn2Qv_et7hUxUuVuPeFPUZdprDc84hwFjbJm0wa_A@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Wayne Yeung
Back to top
Re: Need GetFocus() for FP 2.6 @Get.

Author: Peter Cushing

Posted: 2016-06-01 08:16:06   Link

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

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/b0727296-4e29-8d07-4a8c-49e3b417af13@whisperingsmith.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Peter Cushing
Back to top
Re: Need GetFocus() for FP 2.6 @Get.

Author: Wayne Yeung

Posted: 2016-06-01 08:52:00   Link

Looks like _CUROBJ can only be used within a valid or when.

I tried setting _CUROBJ after the READ but nothing happened.

Thanks for the reply Peter.

Wayne

On Wed, Jun 1, 2016 at 9:16 AM, Peter Cushing <pcushing@whisperingsmith.com>

wrote:

>

> 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

>

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAJDnZHfx5x9HBFD3hm56-4aFk=HKr=dDE+KXtZpxV6kdegdn0Q@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Wayne Yeung
Back to top
Re: Need GetFocus() for FP 2.6 @Get.

Author: Peter Cushing

Posted: 2016-06-01 09:04:55   Link

On 01/06/2016 14:52, Wayne Yeung wrote:

> Looks like _CUROBJ can only be used within a valid or when.

> I tried setting _CUROBJ after the READ but nothing happened.

>

>

Hi Wayne,

You need to set the _CUROBJ in the valid of another object. Usually

when something has happened and you want the input to go back to a

certain object. If you don't use _curobj to change the order then the

read will just move from object No 1 to 2, 3 etc.

Could you expand a little on what you are trying to do and maybe I can

suggest something.

Thanks,

Peter

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

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/00749315-ab77-7c06-f317-46ff2fcca8ae@whisperingsmith.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Peter Cushing
Back to top
Re: Need GetFocus() for FP 2.6 @Get.

Author: Jean MAURICE

Posted: 2016-06-01 09:06:24   Link

Hi Wayne,

 

after the READ, there is no more 'event' you can work with (I mean there are no more active GET). So, yes, _curobj can only be set in functions (clauses ?) called from a @GET command. I remember that you can also set the first GET to be active in the READ statement but I don't remember the name of the clause.

 

If you want to build only one procedure to 'manage' the active GETs, I think you can write your code in the VALID clause of the READ. As long as the valid returns .F., the READ stay active and _curobj is valid.

 

The Foxil

 

 

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/485929873.13303.1464789984862.JavaMail.www@wwinf1e08

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Jean MAURICE
Back to top
Re: Need GetFocus() for FP 2.6 @Get.

Author: Wayne Yeung

Posted: 2016-06-01 10:04:54   Link

I'm coming to realize that this is not possible but this is what I'm trying

to

@ 5,8 say "Effective Date1"

@ 5,24 get date1 valid valdate1()

@ 7,8 say "Effective Date2"

@ 7,24 get date2 valid valdate2()

store " " to yorn

@ 9,8 say "Type Y to continue blank to cancel";

color scheme 2

@ 9,50 get yorn;

picture '!'

read

if PassValidationRules() = .f.

setfocus on date2

endif

Do SaveToDB()

I want to do it this way for the following reasons:

-centralize my validation

-avoid touching legacy code (valdate1, valdate2) I'm happy to add code but

I like to avoid editing existing code

-valdate1 and valdate2 does not run if the user hit the escape key

Thanks

Wayne

On Wed, Jun 1, 2016 at 10:06 AM, Jean MAURICE <jsm.maurice@wanadoo.fr>

wrote:

> Hi Wayne,

>

>

>

> after the READ, there is no more 'event' you can work with (I mean there

> are no more active GET). So, yes, _curobj can only be set in functions

> (clauses ?) called from a @GET command. I remember that you can also set

> the first GET to be active in the READ statement but I don't remember the

> name of the clause.

>

>

>

> If you want to build only one procedure to 'manage' the active GETs, I

> think you can write your code in the VALID clause of the READ. As long as

> the valid returns .F., the READ stay active and _curobj is valid.

>

>

>

> The Foxil

>

>

>

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAJDnZHf57ZDvOuj3MTvYQ1SU14MB=uz9wTDLPBZkLSVVqBF4Xg@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 Wayne Yeung