On Apr 5, 2006, at 5:46 PM, Charles Ross wrote:
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.
This is not possible in REALbasic.
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
What you want to do is certainly possible -- but what is the label?
Is it another control?
Charles Yeomans
_______________________________________________
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>