Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating in a scan...endscan
Message
From
02/10/2006 21:12:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/10/2006 21:04:56
Arjun Bagojikop
Dynamic Super Software
Sangli, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01158457
Message ID:
01158736
Views:
23
>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)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform