Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using .SetAll()
Message
De
14/03/2008 12:11:48
 
 
À
14/03/2008 12:07:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01302151
Message ID:
01302185
Vues:
11
This message has been marked as a message which has helped to the initial question of the thread.
>>>I have a page with a bunch of buttons on it. It want to set the Visible property to some condition based upon a property inside the button. Something like
>>>WITH myForm.myPageFrame
>>>  loPage = .pages(.activepage)
>>>  WITH loPage
>>>       do some stuff
>>>       .setAll('visible',tag = 'yes','myButtonClass')
>>>       more stuff
>>>  ENDWITH
>>>ENDWITH
>>>
>>>However, when the setAll() line is executed I get a "Variable 'Tag' is not found" error.
>>>
>>>I also tried .tag = 'yes' but the reference would be to the page's Tag, not but button's.
>>>
>>>I've gotten around this by looping through all the buttons but it feels cleaner to do it in the one statement. Is there some way to use setAll() and reference a property inside the objects being "set"?
>>>
>>>Thanks.........Rich
>>
>>What you're attempting to do is to set the Visible property to .T./.F. depending on what the variable tag is. If what you're trying to check is the .Tag property for each control, you'll have to do it in a loop, not with .SetAll().
>
>That's what I wound up doing.
>
>I was hoping there was some syntax which could indicate I wanted the property inside the control. Sort of like
>.setAll('property',@controlproperty = value,'class')
>
>I couldn't find anything like that in the help but it wouldn't be the first time I've missed something in help (and probably won't be the last).
>
>Thanks for responding

Did you see Jim Booth's response? If you have code on the Visible_assign, it can check the object's .Tag property and set it accordingly. You may even use a non .t./.f. value that's passed to indicate you want to use the .Tag property, and the _assign code could deal with it. That would allow you to still set the property to its natural .t./.f. if needed.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform