Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array misinterpreted as prg
Message
De
10/12/2001 15:18:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00592280
Message ID:
00592324
Vues:
13
Nick,

Even though vartype(result) = "U" after the SELECT statement...your IF statement will still evaluate to TRUE, because of the OR. For example:
? "A" # "A" or "B" # "A" && returns TRUE
This causes line 4 to execute even though you don't want it to.


>I have the following code
>
>
>SELECT sum(pinfo.workhour) from pinfo ;
>where person.personid = pinfo.personid into array result
>testresult = VARTYPE(result)
>IF VARTYPE(result) # 'U' OR VARTYPE(result) # 'L'
>   .pf1.p1.txtdisplaycurrentwrkhrs.value = result[1,1]
>   .pf1.p1.txtdisplaycurrentwrkhrs.refresh()
>ELSE
>   .pf1.p1.txtdisplaycurrentwrkhrs.value = 0.0
>   .pf1.p1.txtdisplaycurrentwrkhrs.refresh()
>ENDIF
>RELEASE result
>
>
>When I run the program, I get an error on 4th line as follows:
>
>File "result.prg" does not exist.
>
>
>the variable called "testresult" is returning a 'U', but when the "result" array is evaluated on 4th line I get the above mentioned error. Can some clue me in on this.
>
>Thanks
>Nick Patel
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform