Getting the assigned value of a fill-in

markGreenway

New Member
We are currently writing some generic code to loop through all the widgets on any window and save various properties of those widgets.

Those saved propeties will then be used when that same window is opened later to show the widgets on the window in exactly the same way they where before the window was closed.

I can get the handle of the widgets and query their properties OK but when it comes to fill-ins for example, I need to get both the assigned value and the screen-value of that widget as they may be different.

If I where to reference the fill-in by name it gives me the value I want, for example:

MESSAGE fill-in-1
VIEW-AS ALERT-BOX.

But I cannot seem to get that same value when I use the handle to the fill-in.

Below is some code similar to that which I am using.

/********** Start Of Code Example **********/
DEFINE VARIABLE vHandle AS HANDLE NO-UNDO.

ASSIGN vHandle = FRAME {&FRAME-NAME}:FIRST-CHILD
vHandle = vHandle:FIRST-CHILD.
DO WHILE vHandle <> ?:
MESSAGE vHandle:NAME
SKIP
vHandle:TYPE
SKIP
vHandle:SCREEN-VALUE /* This gives me the screen-value but I also need the real value */
VIEW-AS ALERT-BOX.
vHandle = vHandle:NEXT-SIBLING.
END.
/********** End Of Code Example **********/

Any help or suggestions with this would be gratefully received.

we are using Progress 9.1C on Winows 2000.
 
markGreenway said:
but when it comes to fill-ins for example, I need to get both the assigned value and the screen-value of that widget as they may be different.


Hullo Mark


If I am not wrong, the underlying data value (that resides in the database) can be queried only from the related buffer of the screen widget - that is the related record that you have read into memory.


Regards
Skc
 
Thanks for the reply SKC.

I should have explained in my initial post that the values I am trying to get are not necessarily related to a database record.

They are mostly on windows that are used as front end screens for reports, so the user simply types values into the widgets on the screen and those values are then used to filter the data that is retrieved.

Some of these parameter screens have various options for different types of report.

When a user types into a fill-in only the screen-value is affected until that fill-in is assigned, so we do sometimes assign the screen-value of a fill-in when an option on the screen is changed then if the option is changed back we display the previously assigned value to show that fill-in as it was before.

It is this assigned value that I am trying to get from only the handle to the widget.

Regards,
Mark.
 
I don't think that there's a way that you can do this without some form of static context. The 4GL simply doesn't provide an ASSIGNED-VALUE attribute.

So if you want to do this, then you will need to restort to something like an internal procedure or function that returns a value based on an input parameter. e.g.:

IF pInputField = "FILL-IN-1" THEN RETURN FILL-IN-1.
IF pInputField = "FILL-IN-2" THEN RETURN FILL-IN-2.

etc..

Horrible, but it would work and this kind of code can be generated fairly easily if you have a lot of procedures to apply this to.

The only other thing that I can think of is using the PRIVATE-DATA area of the widget to hold the assigned value. This can of course be referenced by the handle. But wherever the values are assigned you will need to write static code to set the PRIVATE-DATA area:

ASSIGN FILL-IN-1 FILL-IN-1:PRIVATE-DATA = FILL-IN-1.

which is almost (but not quite) as bad as option 1.

HTH
 
After trying lots of different things to achieve the results I am after, I have come to the same conclusion that the only way would be to add extra code to all of our windows to hold the values I am trying to get in a different way.

Maybe Progress will give us a way of accessing the assigned value in a future release.

Thanks to those who posted a reply.
Mark.
 
Back
Top