>Is there a way to assign property values to a group of objects if there is not a value already asssigned? I'm looking to set all the HelpContextID properties for objects on a page (form, pageframe, whatever...) to a specific value unless they have previously been assigned in development. I'm trying to think of a way to use the SetAll method to handle this... Thanks!
>
>Regards, Renoir
Here is a sample assign method that will do what you want.
This code makes two assumptions:
1. If you don't set the HelpContextID it defaults to 0.
2. Sometimes you may want SetAll("helpContextID" ##) to really set them all, and other times just the ones that are still the default value.
In your base class, create an assign method to HelpContextID and a new property ProtectHelpContextID. The property defaults to .F.
This code in the new assign method will do the job
LPARAMETERS vNewVal
IF (This.ProtectHelpContextID = .F.) OR (This.HelpContextID = 0)
THIS.HelpContextID = m.vNewVal
ENDIF
And use this code to change defaults to 999
form.SetAll("ProtectHelpContextID",.T.)
form.SetAll("HelpContextID",999)
form.SetAll("ProtectHelpContextID",.F.)
David.