Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Quiz in KB...
Message
De
07/07/1999 18:04:19
 
 
À
07/07/1999 18:00:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00238575
Message ID:
00238576
Vues:
21
>So there I am... taking the 10 random quiz questions. I get one that says something like: "What do you get when you run this?
>
>x = 7
>y = 8
>IF X > 3 .AND Y < 4
>WAIT WINDOW "X > 3, Y < 4"
>ELSE
>WAIT WINDOW "X <= 3 and/or y >= 4"
>ENDIF
>
>a.WAIT WINDOW "X > 3, Y < 4"
>b.WAIT WINDOW "X <= 3 and/or y >= 4"
>c.Bad Command
>d.Both windows"
>
>So I chose c. But then it said I was wrong. So I copied it and ran it and it gave me a bad command error. I use VFP6 and the question stated VFP3 but I didn't think it changed like this. Can anybody expound on this matter and hopefully untarnish my pride?! Oh well, I just got over it!
>
>Mike Helland

Yes. It's an example from the Hacker's Guide to VFP 3.0.
Apparently in VFP 3.0 and before you were allowed to place comments on the same line as your if statement. The way that FP dealt with that is as soon as it hit a syntax error it would just make the rest of the line a comment.

In this example the missing "." in the "AND" is what is causing the problem. It evaluates only the first part of the if and the rest of the if it just acts as if its a comment.

HTH

Dan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform