Discussion:
how to change setkey(....) functionality during get
(too old to reply)
m***@gmail.com
2017-06-26 09:03:08 UTC
Permalink
Hi,
I'm facing a problem I don't know how to solve.
I've a complex get with several fields that may be populated directly with a code or found by activating an F.. key with a lookup in a linked table.
For each get object I may have different f.. keys with diferent functionality, i.e.
@ 2,2 get cvatcode pict "@!" (pressing F2 opens a tbrowse to lookup, pressing F4 opens a frame with the amounts divided by code)
@ 3, 2 get cUM pict "@!" (pressing F2 opens a tbrowse to lookup, but I need to disable F4 key, and, maybe, to enable another F.. key for other purpose.
...
...
READ

In addition each get has it's own message that it isn't at line 24 and centered, but it must be shown at the bottom of the window, whose dimensions and coordinates arent those of the entire screen.
In the past I had solved giving a READ after each get but it's inelegant and with very complex forms it's unmanageable.

There is another way to do it?

Regards
Marco
acc
2017-06-26 09:40:28 UTC
Permalink
Post by m***@gmail.com
Hi,
I'm facing a problem I don't know how to solve.
I've a complex get with several fields that may be populated directly with a code or found by activating an F.. key with a lookup in a linked table.
For each get object I may have different f.. keys with diferent functionality, i.e.
@ 2,2 get cvatcode pict "@!" (pressing F2 opens a tbrowse to lookup, pressing F4 opens a frame with the amounts divided by code)
@ 3, 2 get cUM pict "@!" (pressing F2 opens a tbrowse to lookup, but I need to disable F4 key, and, maybe, to enable another F.. key for other purpose.
...
...
READ
In addition each get has it's own message that it isn't at line 24 and centered, but it must be shown at the bottom of the window, whose dimensions and coordinates arent those of the entire screen.
In the past I had solved giving a READ after each get but it's inelegant and with very complex forms it's unmanageable.
There is another way to do it?
You can use the WHEN clause to pre-validate a get (code is executed when
the get receive the focus) and the VALID clause to post-validate a get
(code is executed when the get lost the focus).
You can use obj:varGet() to obtain the current get object, look at
SRC\SYS\GETSYS.PRG.

PS: c'e' anche it.comp.lang.vo-clipper
m***@gmail.com
2017-06-26 10:34:48 UTC
Permalink
Hi,
thanks for your reply.
I'm aware of the When-Valid clause but i was thinking of a deeper modification of the get system, like, for example, the GET... PASSWORD implementation. Symply, even if I carefully read the examples of GET and examined the code of other authors I'm not able to find a solution (nor I know where to start).

Regards,
Marco
ps. I know it.comp... but currently there are few followers there.
Post by acc
You can use the WHEN clause to pre-validate a get (code is executed when
the get receive the focus) and the VALID clause to post-validate a get
(code is executed when the get lost the focus).
You can use obj:varGet() to obtain the current get object, look at
SRC\SYS\GETSYS.PRG.
PS: c'e' anche it.comp.lang.vo-clipper
p***@gmail.com
2020-06-21 02:29:25 UTC
Permalink
Post by m***@gmail.com
Hi,
I'm facing a problem I don't know how to solve.
I've a complex get with several fields that may be populated directly with a code or found by activating an F.. key with a lookup in a linked table.
For each get object I may have different f.. keys with diferent functionality, i.e.
@ 2,2 get cvatcode pict "@!" (pressing F2 opens a tbrowse to lookup, pressing F4 opens a frame with the amounts divided by code)
@ 3, 2 get cUM pict "@!" (pressing F2 opens a tbrowse to lookup, but I need to disable F4 key, and, maybe, to enable another F.. key for other purpose.
...
...
READ
In addition each get has it's own message that it isn't at line 24 and centered, but it must be shown at the bottom of the window, whose dimensions and coordinates arent those of the entire screen.
In the past I had solved giving a READ after each get but it's inelegant and with very complex forms it's unmanageable.
There is another way to do it?
Regards
Marco
You can create functions touse with WHEN and finalising with VALID

This is worked in portuguese

@ 06,52 GET v_grupo PICT "@!" ;
WHEN podepesq("GRP") ;
VALID acha(v_grupo,"GRP",.F.,1).AND. ;
fala(06,52,v_grupo+" - "+GRP->nomgrup) .AND.;
podepesq("")

podepesq is a function that creates a kind of search/with FUNCTION KEY (something)
acha is FIND/SEEK
fala is Write a frase
the empty podepesq disables the prior function

Loading...