Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do_while?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00912788
Message ID:
00912792
Vues:
13
>hi,
>I tried using "do while" command and it seems to be a bit strange for me but I would like to understand how it works. I used this code:
>
>Create Cursor temp (int1 i, num1 n(4,0))
>DO WHILE recno() < 10
> Insert Into temp (int1, num1);
> Values (RECNO(),RecNo()*10)
>ENDDO
>
>My questions are:
>- How can this command skip on to the next record of the cursor,I mean, what makes it skip? The same recno should fill up the cursor.
>- In the cursor the first record is duplicated. why? (if I put "skip" just before "enddo" the first record is not duplicated - it works as it should)
>- I looked up all the helps(Hentzen's book, VFP help, MSDN, UT) but I've not found any source for that. Any help?
>
>Thanks
>Tamás Szigeti

Create Cursor temp (int1 i, num1 n(4,0))
lnCounter = 1
Do While lnCounter < 10
Append Blank
Replace temp.int1 with lnCounter, temp.num1 with lnCounter * 10
SKIP
lnCounter = lnCounter + 1
EndDo
ICQ 10556 (ya), 254117
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform