Highlighted
Absent Member.
Absent Member.
897 views

[archive] Sharing value variables

[Migrated content. Thread originally posted on 20 October 2004]

It doesn't seem possible for controls to share value variables. For instance I have an application with a tab control with 5 pages on the control. There is data that we want to carry from tab to tab for reference.

I put the add/change entry fields on page 1 of the tab and put "read-only" entry fields at the top of the screen to display constantly. I thought just giving the "read-only" entry fields the same varibles as the add/change entry fields would accomplish this. Doesn't seem to be the case.

Is this the rule or am I missing somenthing?

Vins Nash
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

I've had the same problem. I have to use different variables on each page of the tab and duplicate the information.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

I guess it's the rule.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

Correct. Remember that a control is not explicitely a part of your application. It is a separate entity, although hosted by your application. Thus, when providing or getting data from a control. You are passing actual data, not addresses, thus, you cannot share.
This is the desing of ActiveX architecture and not a limitation of ACUCOBOL-GT.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

I think that when you use the same VALUE variables for the different ENTRY-fields it should display always the same value on the different TAB's. We use it this way and it is working fine for us. For example:
03 V0101 ENTRY-FIELD .. VALUE WS-FIELD
03 V0201 ENTRY-FIELD .. VALUE WS-FIELD
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

Originally posted by jmagielse
I think that when you use the same VALUE variables for the different ENTRY-fields it should display always the same value on the different TAB's. We use it this way and it is working fine for us. For example:
03 V0101 ENTRY-FIELD .. VALUE WS-FIELD
03 V0201 ENTRY-FIELD .. VALUE WS-FIELD


As I said, when you modify the control, you are passing the data, e.g. Even though ctrl1, ctrl2 .. ctrln all uses WS-COMMON-VARIABLE, the runtime is "smart" enough to only update those affected by the MODIFY statement. Thus, when you do a:
MODIFY ctrl1 VALUE = WS-COMMON-VARIABLE.

The runtime will only modify ctrl1, not the others. This is by design, and believe me, with a complex screen and perhaps Thin Client, you would be very sorry if it did not behave this way.

Now, having said this, I was moving a bit fast here, because there are in fact some cases that the address is being passed instead of the value of the variable. In those cases, you should get the effect you desire, but those cases will not be likely to be seen commonly for non ACUCOBOL-GT controls.

The reason ENTRY-FIELD works the way you desire, is because it is a ACUCOBOL-GT built in component.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Sharing value variables

Vins,

Another way you could do this would be to take the 'common' entry-fields out of each individual tab 'page'. That way they would always be visible, regardless of whether the individual pages are visible.

Screen section example;

01 Tab-Screen.
03 Common-Field-1 Entry-field value Common-Data-1.
03 Common-Field-1 Entry-field value Common-Data-2.
03 Tab-Page-1 visible Page-1-visible.
05 ... page 1 controls
03 Tab-Page-2 visible Page-2-visible.
05 ... page 2 controls
more pags...
03 Tab-control ....etc.

Does that make any sense?

BTW, does anyone know why the tab control has to be last? It doesn't make any sense that the last thing in the screen section is displayed at the 'bottom'.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.