Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Caption.label
Message
De
19/06/2006 10:38:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/06/2006 09:57:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01129949
Message ID:
01129969
Vues:
13
I think Q1 was a field in your table, right? In that case, the alias is probably not selected. Either select it first, or include the alias in the variable expression. In other words, your variable should contain, not "q1", but "dnc.q1".

>hi,
>thank you for replay and code,
> i try as under i got error message variable q1 is not found
>
>USE answers IN 0
>        SELECT answers
>             for i = 1 to 3 &&  as example
>  lcKeyField = "Q" + trans(i)
>  thisform.text42.Value= lcKeyField && to check
>   if ThisForm.List1.Value = eval(lcKeyField) && e.g., equal to Q1
>    ThisForm.Label1.Caption = eval("DNC.Q" + trans(i)) && e.g., Q1
>    ThisForm.Label2.Caption = eval("DNC.Q" + trans(i) + "1") && e.g., Q11
>    *...
>  endif
>next
>
>Select answers
>
>thanks
>
>
>>In your particular example, it seems practical to have variables which store the names of both labels, and table fields.
>>
>>Something like this:
>>
>>
>>for i = 1 to ...
>>  lcKeyField = "Q" + trans(i)
>>  if ThisForm.List1.Value = eval(lcKeyField) && e.g., equal to Q1
>>    ThisForm.Label1.Caption = eval("DNC.Q" + trans(i)) && e.g., Q1
>>    ThisForm.Label2.Caption = eval("DNC.Q" + trans(i) + "1") && e.g., Q11
>>    ...
>>  endif
>>next
>>
>>
>>>hi all,
>>>
>>>i need your help,
>>>i try to change many lables at my form , depend field value as under,
>>>
>>> USE answers IN 0
>>> SELECT answers
>>>&&&&my field name is QUESTION have q1 to q15
>>>
>>>           IF THISFORM.LIST1.Value=answers.QUESTION=Q1  &&  example
>>>USE DNC IN 0
>>> SELECT DNC
>>>                 THISFORM.LABEL1.CAPTION=DNC.Q1
>>>                 THISFORM.LABEL2.CAPTION=DNC.Q11
>>>                 THISFORM.LABEL3.CAPTION=DNC.Q12
>>>                 .
>>>                 .
>>>                 .
>>>
>>>             else
>>>           IF THISFORM.LIST1.Value=answers.QUESTION=Q2
>>>             *******************
>>>                 THISFORM.LABEL1.CAPTION=DNC.Q2
>>>                 THISFORM.LABEL2.CAPTION=DNC.Q21
>>>                 THISFORM.LABEL3.CAPTION=DNC.Q22
>>>                 .
>>>                 .
>>>                 .
>>>
>>> ENDIF
>>>endif
>>>         Select answers
>>>
>>>
>>>thanks
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform