Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy form a to c
Message
From
10/12/2004 16:51:36
 
 
To
10/12/2004 16:05:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00968412
Message ID:
00968432
Views:
8
>hi all,
>is there another way to make this copy
>
>CLOSE ALL
>SET SAFETY OFF
>SET ECHO OFF
>SET STATUS OFF
>
>set defa to a:
>COPY FILE MSTR.DBF TO D:\COPYFIELS
>COPY FILE TRANS1.DBF TO D:\COPYFIELS\TRANS1.DBF
>=MESSAGEBOX("finished")NOWAIT
>
>thanks.
>m.qasem

A couple of things.

1. There isn't really a need to SET DEFA TO A: since you can specify A: as part of the file specification.

2. I might be making a bad assumption here, but it looks as if you have been very careless with your names. Your code will take A:MSTR.DBF and copy it to a FILE named COPYFIELS in the root directory of the D drive. Is that what you wanted to do? Since you are putting TRANS1.DBF in a directory with the name COPYFIELS on the D Drive, You are not doing what I think you intended.

3. Assuming that you want to make a copy of a data table, your method will not get any memo fields or indexes that are associated with that table. If there are memo and/or index files, rather than name them explicitly, try something like
lnCurWa = SELECT()     && save the current work area
SELECT 0               && move to an unused work area
USE A:MSTR
COPY TO D:\COPYFIELS WITH CDX
USE A:TRANS1.DBF 
COPY TO D:\COPYFIELS\TRANS1 WITH CDX
USE                    && Close the file
SELECT (lnCurWa)       && Return to the previous workarea
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform