Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor
Message
From
13/01/2014 15:51:28
 
 
To
13/01/2014 15:29:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Cursor
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01591784
Message ID:
01591789
Views:
42
>I want to create a text file that displays all email lists from 4 different dbf files. there are many duplications so I wanted to eliminate email duplicates from the other database files. I thought perhaps creating a cursor would be the way to go.
>I have not used cursor in my programming and would like to give it a try if you thought it might be the way to go here. This attempt failed, Can someone please assist and send me on my way to part two. thanks so much
>k
>
>CREATE CURSOR email ;
> (email c(40))
> 
>Use mydbf1
>go top
>do while not eof()
>m_email=rtrim(email)+';'
>INSERT INTO email;
>   VALUES m_email
> skip
> loop
> enddo
>BROWSE
>
You forgot Select 0, plus the Loop command confuses me, not necessary. I prefer Scan-Endscan since it's easier.
CREATE CURSOR email ;
 (email c(40))
Select 0 
Use mydbf1 
Scan
   m_email=rtrim(email)+';'
   INSERT INTO email;
      VALUES m_email
Endscan
BROWSE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform