Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rewrite code
Message
 
À
20/06/2006 03:35:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01130156
Message ID:
01130160
Vues:
16
LOCAL lnFor
thisform.text42.Value = thisform.list1.value
CLOSE all
SELECT 0
USE dnc
FOR lnFor  1 TO 15
    IF thisform.text42.Value = [Q]+TRANSFORM(lnFor)
       LOCATE FOR flag1=1
       ThisForm.Label1.Caption = q1
       ThisForm.Label2.Caption = q11
       EXIT
    ENDIF
NEXT
CLOSE all
USE answers
>hi all,
>
>i need help to rewrite this code under(another way),
>
> lcKeyField = thisform.list1.value
>         thisform.text42.Value= lcKeyField
>      if  thisform.text42.Value = UPPER("q1")
>           CLOSE all
>           USE dnc IN 0
>           SELECT dnc
>        LOCATE FOR flag1=1
>        ThisForm.Label1.Caption = q1
>        ThisForm.Label2.Caption = q11
>        ELSE
>           USE dnc IN 0
>           SELECT dnc
>    if  thisform.text42.Value = UPPER("q2")
>        LOCATE FOR flag1=2
>        ThisForm.Label1.Caption = dnc.q1
>        ThisForm.Label2.Caption = dnc.q11
>    ELSE
>        CLOSE all
>           USE dnc IN 0
>           SELECT dnc
>    if  thisform.text42.Value = UPPER("q3")
>        LOCATE FOR flag1=3
>        ThisForm.Label1.Caption = dnc.q1
>        ThisForm.Label2.Caption = dnc.q11
>    ELSE
>       CLOSE all
>           USE dnc IN 0
>           SELECT dnc
>    if  thisform.text42.Value = UPPER("q4")
>        LOCATE FOR flag1=4
>        ...
>        ...
>        .
>        .
>         CLOSE all
>           USE dnc IN 0
>           SELECT dnc
>          if  thisform.text42.Value = UPPER("q15")
>        LOCATE FOR flag1=15
>        .
>        .
>        .
>
>ENDIF
>ENDIF
>ENDIF
>ENDIF
>
> CLOSE all
>USE answers IN 0
>Select answers
>
>
>thanks
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform