Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference a control with the value of a variable
Message
De
26/10/2001 21:24:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00574091
Message ID:
00574097
Vues:
33
Hi Sergey,

You're always a big help.

My error was that I was trying to double dot BEFORE the macro substitution. My bad.

Thansk alot.

Aloha,

James

>Hi James,
>
>You have to double dots because the first dot denotes the end of macro substitution.
>  ThisForm.&lcUpdateCity..Value = ZipCity.LwrCity
>  ThisForm.&lcUpdateState..Value = ZipCity.State
>
>>Hi All,
>>
>>I've seen this done somewhere before but I can't seem to put 1 and 1 together. How do you reference an object using the value of a variable? I'm kind of recalling something like double-dots ThisForm..cControlName.Value..??? I'm not really sure.
>>
>>Here's some background of what I'm trying to do. I have two address blocks on my form, one for the mailing address and one for the residence address (they may be different). I have a simple method that looks up the city and state based on the zipcode provided. I want to pass the method either "MAIL" or "RES" to determine which controls to update the residence or mail.
>>
>>Thanks in advance for all your help.
>>
>>Aloha,
>>
>>James
>>
>>Here's a sample of what the code looks like:
>>************************************************************
>>** ZipLookup(96792, "MAIL")
>>************************************************************
>>
>>LParameters tcZip, tcResOrMail
>>
>>Local lcCity, lcState, lnOldArea
>>
>>lcCity = ""
>>lcState = ""
>>lnOldArea = Select()
>>
>>Select ZipCity
>>Locate for Zip = tcZip
>>If Found()
>>  lcUpdateCity = "txt" + tcResorMail && Build control name???
>>
>>  *!* Here's where my prolem is
>>  *!* This doesn't work and I can't remember what will
>>  ThisForm.&lcUpdateCity.Value = ZipCity.LwrCity
>>  ThisForm.&lcUpdateState.Value = ZipCity.State
>>EndIf
>>
>>Select (lnOldArea)
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform