>I can easily create a new table with
>
>COPY STRUCTURE TO newfile DATABASE mydbc
>
>However if that file exists then I get an error
>
>Normally I do this at the end of a program:
>OPEN DATABASE mydbc
>REMOVE TABLE newfile DELETE
>
>
>However if for any reason the file is not deleted in advance, I get the error.
>
>How can I copy structure to the new one and OVERWRITE an existing one if it is there.
There's no single command, but you could check before creating, e.g.
OPEN DATABASE mydbc
IF INDBC("newfile", "TABLE")
DROP TABLE newfile
ENDIF
COPY STRUCTURE TO newfile DATABASE mydbc
Insanity: Doing the same thing over and over and expecting different results.