Control name as string ??

Started by Kerry Brown · 2013-11-07 09:49 UTC · 1 replies · SMF topic #2058

My old memoty is failing me.
Is there a way to identify a control by a string instead of it's object name.

eg, I thought I could do this ... but it's failing with an 'Error: expected more arguments"
It's been a while since I've used OpenDCL and my grey stuff is slowing down ...


  (setq controlList '("Top" "Bottom"    "Front"    "Back"      "Left"
                            "Right"    "isoSW"    "isoSE"    "isoNE"
                            "isoNW"    "isoSWB"    "isoSEB"    "isoNEB"
                            "isoNWB"    "30+30"    "50+30"    "130+30"
                            "150+30"    "200+30"    "230+30"    "310+30"
                            "310+30"    "30-30"    "50-30"    "130-30"
                            "150-30"    "200-30"    "230-30"    "310-30"
                            "330-30"
                          )
  )
  (setq valuesList '())
  ;;-------------------------------------------
  ;;-------------------------------------------
  (defun c:UCSer_Form_TextButton1_OnClicked (/)
    (foreach name controlList
      (if (= 1 (dcl_Control_GetValue (strcat "UCSer_Form_" name)))
          (setq valuesList (cons name valuesList))
      )
    )
    (dcl_Form_Close UCSer_Form)
    ;;  (cond
    ;;    ( ( )    )
    ;;    )
  )


Regards,
Sorted !




      (if (= 1 (dcl_Control_GetValue "UCSer" "Form"  name))
        (setq valuesList (cons name valuesList))
      )



did the trick.