hi,
thank you very much,
best regards.
m.qasem
>>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()
>SELECT 0
>USE A:MSTR
>COPY TO D:\COPYFIELS WITH CDX
>USE A:TRANS1.DBF
>COPY TO D:\COPYFIELS\TRANS1 WITH CDX
>USE
>SELECT (lnCurWa)
>