Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I'm not a DOS programmer anymore
Message
From
26/12/1999 18:40:34
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00308656
Message ID:
00308671
Views:
16
>I have some processing of records to do & I'm thinking like a DOS programmer. Please help me think like a VFP programmer.
>
>I have a table on a floppy disk named people. I have a table in my project called people (which I've given an alias of peo). I want to read through the table on drive a, check to see if it's in people & replace certain fields if it is or add the record it it's not.
>
>In DOS, I said
>select 1
>use a:people
>sele 2
>use people alias peo
>set order to dnumber
>sele 1
>do while not eof()
> sele 2
> seek people.dnumber
> if found()
> replace ...
> else
> appe blank
> replace ...
> endif
> select 1
> skip
>enddo
>
>How do I do this in VFP?
>
>Many, many thanks for your help.

That code should still work...
A couple of minor changes will reduce the amoutn of code...
USE PEOPLE ORDER Dnumber ALIAS PEO
SELECT 0
USE A:\PEOPLE
SCAN
IF SEEK(DNumber, 'Peo')
REPLACE .... IN Peo
ELSE
INSERT INTO Peo (field...) VALUES (values...)
ENDIF
ENDSCAN && Peo
Previous
Reply
Map
View

Click here to load this message in the networking platform