Query globallist display values in a label in the forms designer

Hello,

 

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?

 

Example:

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
Two

 

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

 

Thanks!

Robert

Parents
  • 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

  • Verified Answer

    Hello,

     

    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!

Reply
  • Verified Answer

    Hello,

     

    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!

Children
No Data