Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scanning through objects to assign property values
Message
From
17/05/2001 15:37:40
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
17/05/2001 13:47:41
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00508436
Message ID:
00508484
Views:
21
This message has been marked as a message which has helped to the initial question of the thread.
>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
*: Change property to new value if permitted or if default value
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform