Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating in a scan...endscan
Message
De
02/10/2006 21:12:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
02/10/2006 21:04:56
Arjun Bagojikop
Dynamic Super Software
Sangli, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01158457
Message ID:
01158736
Vues:
25
>because
>i dont know where is record position in that table/cursor
>but i want to scan from top of file

SCAN will go to the top of the table automatically!
go top && is not required
scan while not eof() && "while not eof()" is not required
  do something
endscan
You only need:
scan
  do something
endscan
Some programmers use "do while not eof()", which is a waste of the programmer's time.

If you use a SCAN, the following are implicit:

  • go top (before the SCAN) - the SCAN will start at the beginning anyway.
  • while not eof() - SCAN will stop at the last record anyway
  • SKIP - SCAN will automatically go to the next record. (An additional SKIP would process only one out of every two records.)
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform