Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scanning through objects to assign property values
Message
De
17/05/2001 15:37:40
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgie, États-Unis
 
 
À
17/05/2001 13:47:41
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00508436
Message ID:
00508484
Vues:
20
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform