General information
Category:
Coding, syntax & commands
Hi John,
This Feature has been around since at least FPD2.6. When control returns to the top of the SCAN the file that was originally being scanned is reselected even if another work area is selected, so there's no need to reselect it just before the ENDSCAN. I always reselect anyway just in case later versions don't support this.
Gavin...
>Hey UT folks -
>Sometimes I feel like a total idiot savant with VFP. Some features I know as well as the people who designed them, then I hit something like this .. which is probably something everyone but me knew about.
>
>Here's the feature I didn't know about, but came across by accident:
>
>Did you know that when you issue a SCAN/ENDSCAN VFP automatically flips a SELECT back to the correct file when hitting the ENDSCAN without you having to explicitly doing so?
>
>Here's an example program:
>
>SELECT j1
>
>SCAN
> SELECT j2
> LOCATE FOR ord = j1->rec
> IF NOT FOUND()
> APPEND BLANK
> REPLACE ord with j1->rec
> ENDIF
>ENDSCAN
>
>Now I would have expected this to bomb, because I didn't issue a 'SELECT j1' after the REPLACE and there's no 'ord' field on the 'j2' file. But when the program hits the ENDSCAN, it reverts to 'j1' automatically!
>
>Please someone tell me this is new and not been around since VFP 3 or FoxPro 1.0. Yeesh!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only