|
Purpose |
Sorts an extract file | |
|
Old name |
#define sort_extract extract_sort | |
|
Syntax |
int extract_sort(void); | |
|
Description |
The extract_sort() function sorts an extract file, using the DP4 program SORTEXTR. The sorted field of the header record EXT_HEADER is set to TRUE by the SORTEXTR program and used to check that the sort was successfully run. The extract file must have been previously created by a call to the function extract_open(). See this function for details of how to write your own sort program. The progress of the sort program is normally displayed on the screen. To suppress this, set the suppress_output field of the header record EXT_HEADER to TRUE. If this is done, a 'please wait' message is displayed before calling the function extract_sort(). The function extract_sort() calls the function trm_run_program() with the following parameters: | |
|
|
Parameter |
Description |
|
|
name |
"sortextr <extfile>", where <extfile> is the filename passed to the function extract_open() |
|
|
batch |
FALSE. Do not run as a batch program |
|
|
copy_screen |
TRUE. The screen as it is when sortextr completes is copied to this applications screen buffer. (This is only effective on MS-DOS,FlexOS, and OS/2), and may be undesirable. |
|
|
If you want the third parameter to the function trm_run_program() to be FALSE, you must write your own version. This is shown in the example under extract_open(). | |
|
Return values |
Returns the sorted field of the EXT_HEADER header record | |
|
See also |
extract_open(), extract_write(), extract_read(), extract_close() | |
|
Example |
See the example in extract_open() | |
|
Remarks |
The sort algorithm used is a variation on natural merge-sort:
| |