Lemonjuice,
I had a quick look under help using 'restructure' as the keyword and found this:
"Restructures a table.
Syntax
restructure( const createSpec DynArray[ ] AnyType ) Logical
Description
restructure allows you to modify a table's structure under program control. You can add, delete, or modify the fields in your table, create indexes, change referential integrity relationships, and so on. restructure also allows you to perform other operations that are available when restructuring a table (for example: packing the table).
restructure uses a dynamic array named createSpec, which contains the information on the changes to make to the table.
To specify the kind of change to be made, the field, index, referential integrity, and security structure tables, if specified, must include an ID field. This ID field is named slightly differently in each structure file, however, all end with id. Use this ID field to specify the type of operation to perform. The RestructureOperations constants RestructureModify, RestructureAdd, and RestructureDrop are provided for each operation.
restructure returns True if successful, and False if the restructure operation fails, or if a Keyviol or Problems table is generated. It also fails if it cannot obtain a full lock on the table.
The following clauses specify table attributes in createSpec and are optional. They can appear in any order within the dynamic array:
saveAs specifies a new name for the restructured table, leaving the original table unchanged. By default, the restructured table is saved with the same name, which overwrites the original table.
Keyviol specifies the table to which any records causing a key violation are saved.
Problems specifies the table to which any problem records are saved. If data is lost during the restructure, the problem records are placed in the problems table, and the operation that caused the problem is not performed on those records.
fieldStruct specifies the name of the table from which you can borrow field structure information. Use enumFieldStruct to generate the field structure table before executing restructure. The _Invariant Field Id field of the field structure table contains the original field number of the table to be restructured. Use the _Invariant Field Id field to specify the change to be made to the table. To add a field, insert a new record in the field structure table describing the new field and place 0 in the _Invariant Field Id field. To delete an existing field, remove the record from the field structure table.
indexStruct specifies the name of the table from which you can borrow index structure information. Use enumIndexStruct to generate the index structure table (or create it manually). Use the iIndexId field of the index structure table to specify the change to be made to the table. To modify an index, use RestructureModify in the iIndexId field. You can modify an index name by dropping (RestructureDrop), and adding (RestructureAdd) another record with the changed name.
refIntStruct specifies the name of the table from which you can borrow referential integrity structure information. Use enumRefIntStruct to generate the referential integrity structure table (or create it manually). Use the iRefId field of the referential integrity structure table to specify the change to be made to the table. Use RestructureModify to modify existing values, RestructureAdd to add, or RestructureDrop to delete.
secStruct specifies the table from which you can borrow security structure information. Use enumSecStruct to generate the security structure table name (or create it manually). Use the iSecId field in the security structure table to specify the change to be made to the table. Use RestructureModify to modify existing values, RestructureAdd to add, or RestructureDrop to delete.
pack specifies whether to pack the table. Valid values are True or False. For more information, see compact (Table type).
versionLevel specifies the table version level. See create for a listing of version numbers for Paradox and dBASE tables.
languageDriver specifies the language driver name. For a list of language drivers for Paradox tables, see Language drivers for Paradox tables. For dBASE tables, see Language drivers for dBASE tables.
blockSize specifies the size of data blocks used to store information in the table, in kilobytes. (A kilobyte is 1,024 bytes.) Valid block sizes depend on the file format of the table. For Paradox versions 4.5 or earlier, 1K through 4K are valid. For versions 5.0 and later, 1K through 4K, 8K, 16K, and 32K are valid.
warnings specifies whether warnings encountered during the restructure operation are displayed. Valid values are True or False. If warnings is set to True, warnings can be placed on the error stack for examination.
If errorTrapOnWarnings is set to True, the first warning generated terminates the restructure operation."
You should find something in this lot to help.
Regards,
Lewy