Wiki Home

Set All


Namespace: Wiki
The Set All Method allows you to set the same property on numerous objects in a container in one shot. You don't have to write code to loop through the objects in that container.

Is it impossible to use Set All with properties that were added programmatically? This bombs at the final line with the error Property ilTesting is not found.

loForm = CREATEOBJECT("Form")
loForm.Show()
loForm.AddObject("cmgDays","CommandGroup")
DEBUG
loForm.cmgDays.Visible = .t.
loForm.cmgDays.Width = 100
loForm.cmgDays.Height = 100
loForm.cmgDays.AddObject("cmd1","CommandButton")
loForm.cmgDays.cmd1.Visible = .t.
loForm.cmgDays.SetAll("Visible",.F.,"CommandButton")
loForm.cmgDays.SetAll("Visible",.t.,"CommandButton")
loForm.cmgDays.cmd1.AddProperty("ilTesting",.F.)
loForm.cmgDays.SetAll("ilTesting",.t.,"CommandButton")

You can get this thing to work if you do not include the Class parameter:
loForm.cmgDays.SetAll("ilTesting",.t.)
- Eric Den Doop

Thanks Eric! -- Mike Yearwood
Mike Yearwood
Category VFP Methods
( Topic last updated: 2003.04.21 03:50:15 PM )