Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy data from floppy to hard disk - what's wrong?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00321783
Message ID:
00321796
Views:
22
Hi Ellen,

You forgot to re-select document again at the end of DO WHILE.

Also I would recomend to use SCAN...ENDSCAN instead of DO WHILE and Insert-SQl instead of APPEND BLANK AND GATHER.

See code below
sele doc
set order to dnumber
select 0
use a:\document
SCAN
  scatter memvar memo
  IF seek(document.dnumber, "doc")
    select doc
    gather memvar memo
  else
    Insert Into doc from memvar
  endif
  select document
ENDSCAN
>I'm trying to copy data from a floppy disk onto the hard drive. I know how to do this in DOS but am having trouble in VFP. I've attached the code. Right now it's duplicating everything on the C drive. My 3rd sele line that says sele document is where the problem is I think. How do I get VFP to know that document is the table on the floppy?
>
>TIA
>
> select 0
> use a:document
> sele doc
> set order to dnumber
> sele document
> do while not eof()
> scatter memvar memo
> select doc
> seek document.dnumber
> if not found()
> sele doc
> append blank
> gather memvar
> else
> select doc
> gather memvar
> endif
> select doc
> skip
> enddo
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform