Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Caption.label
Message
De
19/06/2006 09:37:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/06/2006 09:23:03
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:
01129953
Vues:
12
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