For Programmers: Free Programming Magazines  


Home > Archive > Clipper > April 2004 > combined get field and description









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author combined get field and description
Andreas Moroder

2004-04-07, 12:30 pm

Hello,

in our clipper program we have often get field containing codes and near
to this field we print the descriptio of this code.
As a example:

a get field with the state/province code and at the right the name of
the state/province.

Actualy

we have code of the type

show_desc(m_xy, 10,20,"TYPE1")
show_desc(m_ab, 11,20,"TYPE2")

then

@ 10,10 get m_xy valid show_desc(m_xy,10,20,"TYPE1")
@ 11,10 get m_xy valid show_desc(m_xy,10,20,"TYPE1")

read

If we show a existent record, than first we display the descriptions,
then enter the get/read and display. The valid statement is used to
reprint the description.
The problem is that I have the position in three places. I can optimize
by use :pos and :col properties of the geet when using show_desc in the
valid statement, but the first call to show_desc remains and needs the
coordinates.

Does anyone know a cleaner way to solve this ?

Is there a way to expand the functionality of the get statement to
1. print the desciption when creating the gets ( or entering read ) ?
2. redisplay the description when the get changes while not misusing the
valid statement ?

Thanks and Happy Easter ( Frohe Ostern, Buona Pasqua )

Andreas
Stephen Quinn

2004-04-07, 7:30 pm

Andreas

> Is there a way to expand the functionality of the get statement to
> 1. print the desciption when creating the gets ( or entering read ) ?

Write your own GET UDC (and possibly a GetReader()) storing your 'Description' in the cargo slot and
have the Reader re-display it when validation takes place.
Eg. - Taken from Grumpfish
#xcommand @ <row>, <col> GGET <var> ;
[PICTURE <pic>] ;
[VALID <valid>] ;
[WHEN <when>] ;
[PROPER] ;
[MESSAGE <message>] ;
[COLOR <color>] ;
;
=> SetPos( <row>, <col> ) ;
; AAdd( ;
GetList, ;
_GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}> ):display();
) ; ;
ATail(GetList):reader := { | g | GFReader(g, ;
{ | get, key | gkeyproper(get, key) } ) } ;
[ ; Atail(GetList):colorDisp( <color> )] ;
[ ; Atail(GetList):cargo := { <message> } ]

--
HTH
Steve Quinn


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com