Search code examples
assignopenedgeprogress-4gl

ASSIGN a value to an attribute of a widget within a frame


While learning Progress 4GL, I stumbled upon following piece of code, assigning a value to an attribute of a widget within a frame:

ASSIGN Rep-Editor:READ-ONLY IN FRAME Dialog1 = YES
       Rep-Editor:SENSITIVE IN FRAME Dialog1 = YES.

As you can guess:
Dialog1 is the name of the frame.
Rep-Editor is the name of the widget, placed within the frame.

This looks very confusing to me: it's like saying that the value of the frame equals "YES", I expect the assigned variable and value to be next to each other, something like:

ASSIGN Dialog1.Rep-Editor:READ-ONLY = YES, /* or: */
ASSIGN Dialog1->Rep-Editor:READ-ONLY = YES

This, obviously, is not the right syntax. Is there a Progress syntax, similar to this one, that I can use?


Solution

  • Well ... that’s almost 40 year old ABL syntax ...

    You could wrap everything inside a

    DO WITH FRAME Dialog1:
      ASSIGN Rep-Editor:READ-ONLY = YES
             Rep-Editor:SENSITIVE = YES.
    END.
    

    block.