Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do_while?
Message
De
14/06/2004 07:48:43
 
 
À
14/06/2004 06:34:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00912788
Message ID:
00913378
Vues:
18
INSERT leave the record pointer to the new record. RECNO is evaluated before the INSERT take place. So, since RECNO return 1 for an empty cursor and since you move the record pointer to the end of file after each insert, your code should work. But beware that if you enable table buffering, your code won't work anymore, because RECNO will return -1 on uncommited insert.

>Thanks for your answer but if the INSERT sould do what you said, then in the following example the "SKIP" should make every second record leave out.
>
Create Cursor temp (int1 i, num1 n(4,0))
>DO WHILE recno() < 10
>  Insert Into temp (int1, num1) Values (RECNO(),RecNo()*10)
>  SKIP
>ENDDO
>
>It is because when the recno() is evaluated first and the INSERT fills the first record and moves the record pointer to the next one, the SKIP should moves the record pointer to the following record so the actual record pointer is now on the the third record. Am I thinking right?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform