• Getting and Setting Values of GControls:
    • All of the GControls have a .value that can be used from the macro.
    • When the PANEL is created the /CONTROLS=GC switch can be added in.
      • This tells GCONTROL to put a reference for each control into the GC table.
        startmacro
          pipe on
            panel/controls=gc
            
            gcontrol lval mynum "MyNum" 50 0 100 5
            
            res gc.mynum.value
          pipe off
        endmacro
    • When a user changes the value of a GControl, the control sends a message to the macro.
      • This message can be viewed in the processMessage procedure.
        startmacro
          pipe on
            panel/controls=gc
            
            gcontrol lval     mynum "MyNum" 50 0 100 5
            gcontrol calendar mycal 
            gcontrol button   mybtn "My Buttons" "RED,WHITE,BLUE"
          pipe off
        endmacro
        
        procedure processMessage m:msg
          say "Got message name=^msg.name info=^msg.info data=^msg.data"
        return
        
    • NOTE: Certain message names are reserved and have special uses. These names should be avoided when composing messages. Also, since command id's become the message name when interacting with the macro, users should not assign any commands (including gcontrols) an id with one of these reserved names:
         EXIT
         ERROR
         EXEC
         MACRO