Navigation:  CodeBase >

How the restructure process works for DBF files

Print this Topic Previous pageReturn to chapter overviewNext page

 

You would restructure a file when you change the FD in Maintain Data Dictionary.  When the program (MDD) restructures a CodeBase (type C) file it calls the RESTRUCTURE_DBF() function.  The following occurs:

 

1.  The original files are renamed to $$$$RST.ext where ext = DBF, MDX and, if appropriate DBT (Memo file).

 

2.  A new file is created with the modified FD.

 

3.  Both old and new files are opened.

 

4.  The program searches through the new file and matches ShortFieldNames in the old file.  If there isn't a match in the old file for a new file field, it is ignored during the restructure process.

 

5.  A record in the old file is read.

 

6.  The fields are transferred from the old to the new if there are matching names (see #4).

 

7.  The new record is saved.

 

8.  Loop back to #5 until all the records in the old file have been read.

 

NOTE:  The most important part of this process is that if you change the ShortFieldNames in the modified FD that those fields in the current files WILL NOT be moved to the new file.

 

NOTE:  The restructure process also does an automatic pack since only the active records in the old file are read.

 

 

 


Page url: http://www.cassoftware.com/tas/manual/howtherestructureprocesswo.htm