It is possible in REALbasic to have variable variables, similar to what PHP has with the $$ notation? For instance, can I have a variable that holds a string that is the name of another variable or property and somehow access the property.

Specifically, I want to check for blank edit fields in a window. The edit fields are all named "XXXEditField". If the field is blank then the label, named "XXXLabel" should be in red and the first blank field should have the focus. So far my code looks like this:

for i = 0 to self.ControlCount - 1
  if self.Control(i) isa EditField then
    if EditField(self.Control(i)).Text = "" then
      if not foundFocus then
        foundFocus = true
        RectControl(self.Control(i)).SetFocus
      end if
      dim controlName as String = Control(self.Control(i)).Name
dim labelName as String = Replace(controlName, "EditField", "Label")

// This is where I would somehow set self.$$labelName.Color to red.
    end if
  end if
next

Thanks,
Chuck Ross
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to