Table of Contents
Previous Go to Robert Ramey Software Development Home Page next

4. Postman's Sort for Windows

The Postman's Sort Developer's Kit includes the program file PSORTW.EXE. This a a version of the program compiled to operate as a Windows program.

Sorting is generally not an interactive activity. PSORTW operates in the following manner:

a) The program is launched by the Program Manager. Command line arguments are used just as for other versions of psort. They are required to specify the file to be sorted and what fields are to be used.

b) If the -q command line switch is NOT used

i) A window is opened up and the copyright message is displayed. The cursor is changed to and hourglass when ever it is over the Postman's Sort window to indicate that sorting is in progress.

ii) When sorting is complete, the cursor changes to an arrow. Any message window stays on the screen until it is erased by clicking the window close button with the mouse.

iii) Sorting can be aborted at any time by double clicking the window close button. When this is done, A message indicating that the sort was prematurely terminated appears in the Postman's Sort window. The window is closed by double clicking the close button another time.

c) If the -q command line switch IS used:

i) PSORTW starts up as an icon. The icon remains present as long as sorting continues.

ii) If an error is encountered during the sort, the icon in expanded to a window that contains an explanation of the error condition. After the message has been read, the window close button may be double clicked to erase the window.

iii) If no error is encountered the icon disappears when the sort terminates.

d) PSORTW yields to windows during other applications while sorting. Thus a long sorting job will proceed in the background while work is being done on other applications.

The -m switch is more important when sorting under windows. This switch is used to specify the maximum amount of memory that the Postman's Sort will be permitted to acquire. Sorting a file larger than memory may interfere with other applications. If this is a problem the -m switch be used to specify a maximum amount of memory to be used by the sort.

The easiest way to setup sorting is the create an icon with the program manager which contains the command line to be sorted.