Query globallist display values in a label in the forms designer



does anyone know if there is a way to query specific array elements of a globallist in a form to be displayed in a label?



We have a globallist variable $G.test.disp with the values {"One", "Two", "Four", "Five"} and want to put "Two" in a label at a form.


In the RAD Debugger I can query the value with:


>d 2 in $G.test.disp


But how can I query it in the forms designer?


I've tried:

$G.test.disp(2) => Result: Emtpy

$G.test.disp[2] => Result: Emtpy

2 in $G.test.disp  => Result: Emtp

$G.test.disp > Result: "One




  • Hi Robert...is the goal to dynamically change the Label on the format while users interact with it?


    There are several documents on DVD (Dynamic View Dependencies) in the Help Server. Additionally, there is a form named "dep.g" (accessed via Forms Designer) which has examples of various DVD configurations. An important configuration item is that any field or variable used in a DVD expression needs to be on the format.


    The Caption Condition property of the Label control provides the option to dynamically change what is displayed. The syntax for this DVD statement (known as "field value matching") is included below:


    FIELD ? ValueList : DisplayList


    where FIELD is any variable or file field surrounded by square brackets and the ValueList/Display are comma-separated lists of values.


    Example where the Label's Caption changes based on the value in the severity field:

    [severity] ? "1","2","3","4" : "One","Two","Three","Four","None"


    Unfortunately, I'm not aware of a working configuration where the hard-coded list is replaced with a global variable (with this type of DVD statement).


    If the primary need is to specify the value when first entering the form, then another option is to build a thread/global variable in Format Control Calculations or Display Screen expressions.


    Example in Format Control Calculations:

    Initial: true

    Calculation: $G.custom.label=2 in $G.test.disp


    Note: Using global/thread variables typically means the solution needs to manage the creation and cleanup of the variables

  • Did you try $G.test.disp,2 - you hcan normally use a comma and then the index to reference a specific element of an array.
  • Verified Answer



    thank you for your detailled response.


    The goal was to localize the value of a few labels. I planned to save them in a globallist and then localize that list.


    With your suggestions I figured out a better way then using gl:


    I saved the values in the scmessage table and added a new calculation to the format control:

    $G.example=scmsg("1", "example_class")


    Since the scmessages table is localizable I can just use $G.example in the forms designer and get the correct language value.


    Thanks again!

  • @randallfharvey:

    Just tried it, results in an emtpy label aswell.