New Labeling Requirement for Section:
A Label to read the "desList" parameter out of the member object, to be placed in section. The Label would automatically update when the "qty" or "mem_typ" is changed.
Trials and results:
My investigations lead me to believe that there are two methods in GDL for passing parameter values from an object to a label: the Free Users' Globals, and REQUEST("ASSOCLP_PARVALUE").
I have written a simple label based on one the GS labels, and tried writing text based on both methods. In testing the two methods, I spend a lot of time tripping over oddities in the label tool itself. (The subtle difference between placed labels and associated labels. Only associated labels can display ID. Why? Sometimes checking the 'Label Elements' box does nothing. The 'Label Settings' button is ALWAYS greyed out except for default settings, so the only way to get the settings of an associated label is to select the label itself. The label subtype seems to take care of drawing the arrow, since there's no code for it, but sometimes the arrow is not drawn, for no apparent reason. The LABEL_POSITION array is absolutely mystical. Shouldn't it contain the three points clicked when placing the label? I guess not.)
Globals:
There is virtually no documentation of user globals, other than the list of their names. So I just jump in. In the member object's master script, I have the statement: GLOB_USER_15=desList. In the label's 2D script, I have the statement: TEXT2 0, 0, GLOB_USER_15.
(I also tried naming a parameter in the object GLOB_USER_15, and then writing GLOB_USER_15=desList : PARAMETERS GLOB_USER_15=GLOB_USER_15. This didn't solve any of the issues described below.)
This works a small fraction of the time, and I have exhausted myself trying to trace the permutations of various settings to figure out what exactly causes the fraction to work.
These three cases refer to the plan.
1. Associated label on a placed object, i.e., select the object and check the label box: The label displays some default value from the beginning of my experiments, which bears no relationship to the placed object. Rebuild & regenerate does not correct the data. The only way to make the label correct is to change the object then do the R&R.
2. Placing a labeled object, i.e., setting up the label in the default settings, checking the box, then placing the object: The label is correct, but the arrow does not draw. Changes to the object are not reflected in the label until R&R.
3. Placing a label with the label tool: The label contains a different, default, unrelated value. R&R does not fix it. Changing the object followed by R&R fixes the label.
In the section, which is, remember, the goal, the results are even worse. Updating of associated labels is erratic, and sometimes fails even after changing the object/R&R. Updating of placed labels ALWAYS fails.
Summary: In the plan, updating is very burdensome, but not impossible. In the section, updating fails utterly in many cases. From a user standpoint, the technique is a complete failure. Requiring an R&R means human error. Requiring fiddling with the object is insane. The differences between placed and associated Labels are confusing and inconsistent. Any reasonable person would run screaming back to the dumb text-Label solution.
REQUEST("ASSOCLP_PARVALUE"):
This is easier to describe because I simply could not get it to work at all.
I have the REQUEST statement itself working, insofar as I don't get an error. I have tried the following in various scripts. The 2D code is TEXT2 0, 0, desList:
1. xx=REQUEST("ASSOCLP_PARVALUE", "desList", nameVar, typeVar, flagsVar, dim1Var, dim2Var, desList)
I read somewhere that the label has to contain the parameter being read, so:
2.!create a parameter desList, to match that in the object
xx=REQUEST("ASSOCLP_PARVALUE", "desList", nameVar, typeVar, flagsVar, dim1Var, dim2Var, desList)
2a. !as above, then:
PARAMETERS desList=desList
I tried using a temporary variable, different from the parameter name:
3. xx=REQUEST("ASSOCLP_PARVALUE", "desList", nameVar, typeVar, flagsVar, dim1Var, dim2Var,
newName)
2D: TEXT2 0, 0, newName
For all cases, the displayed value is null, empty. In the words of someone, it isn't right, it isn't even wrong.
I also tried reading other, ordinary parameters such as "A". No go. I tried reading other returned values, for example, if I try to get the parameter type, it always returns zero, which isn't a type.
I tried some GS labels that contain the REQUEST, and they don't work either, so I know it's not just me.