Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mandatory field, not xxxx
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01342883
Message ID:
01342930
Vues:
7
Hi Moises,

Suppose, we want to change text1 value to 'bbbbbb' and the textbox name 'text1' is in a variable TextBoxToChange.

Here is how we do it without macro

store 'bbbbbb' to ('thisform.' + TextBoxToChange + ".value") && this is the simplest way if we only need to assign something

We're using name expression here.

We can also do it this way:
loTextBox = evaluate('thisform.' + TextBoxToChange) && alternatively can use GetPem here, but I don't have VFP help handy to check the syntax

loTextBox.value = 'bbbbbb'
loTextBox.RunSomeMethod()
There is almost no need for any macros to do object manipulations.

>Naomi
>
>I kept the & because I need a variable to be a member of a form
>
>
>thisform.text1.value= "aaaa"
>
>store "text2" to my myText
>
>thisform.&mytext.value = "aaaa" && does not work
>
>then:
>
>store "thisform." + Mytext + ".value" to txtBox
>
>&txtBox = "aaaa" && now works
>
>
>How would you remove the & from it ?

store 'aaaaa' to ('thisform.' + myText + ".value")
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform