SRDEMO 1.01 LIB DEMO: Sorting Filenames Containing Digits Copyright (c) 1995 by David M. Wincelberg Table of Contents I. Introduction ........................................... 1 II. How to Use ............................................. 2 III. SRLIB Additional Licensing Rules ....................... 3 Appendices: A. Command Line Switches .................................. 3 B. Other FileJockey Software Products ..................... 4 C. License Agreement ...................................... 6 I. Introduction Thank you for trying SRDEMO. It demonstrates a library routine (SRLIB) to sort file names that may contain digits. For example, SRLIB places FILE2 before FILE10. SRLIB can handle long file names and is compiled for Microsoft C 6.0, C 7.0, and VC++ 1.x for the small and large memory models. To assist you in testing SRLIB, included in SRDEMO.ZIP are ZOPEN and ZDEL. These programs create and delete zero size files. ZOPEN can either create a single zero size file or a set of these file based on names in a list file. The list files LISTFILE and LISTFILE.W95 are also in SRDEMO.ZIP. The latter file contains file names with embedded spaces to simulate what will become available with Windows 95. SRDEMO is not limited to sorting a preset number of files. In addition, it does not read the selected directory twice -- once to count the number of files and once to store them in array. Instead, it uses a fast approach which is documented in SRLIB.TXT. The source code SRDEMO.C is included in SRLIB.ZIP. If you decide to purchase SRLIB, you can either GO SWREG (#5947) on CompuServe or use the included order form. Please note that SortRite(TM)'s copyright notice is required in your documentation and you may not make SRLIB's routines accessible to users of your program(s). SRDEMO is a free program and is safe to run on a Pentium processor since it does not perform any floating point divisions of large numbers. It requires DOS 2.1 or higher. Send comments, suggestions and problem reports to me at 71573,1023 by CompuServe e-mail or at 71573.1023@compuserve.com by Internet e-mail. I plan to read each one, but, if I receive a large amount of mail, I may not be able to reply to each letter. II. How to Use II.A. Generating and Removing Test Data Use ZOPEN to produce a set of files whose names you would like to sort properly. For your convenience, two list files of sample names are included in SRDEMO.ZIP. For example, to use LISTFILE enter: ZOPEN @LISTFILE You could also create a single zero size file by entering a command similar to: ZOPEN FILE010 To create another list file, use a text editor to place one file name at the beginning of each line. Don't worry about blank lines. ZOPEN ignores them. Once you no longer need the zero size files, enter ZDEL *.* to delete them. II.B. Sorting File Names Properly Enter: SRDEMO /W This will produce a wide display of sorted file names. You could also leave off the switch to produce a long display -- one file name per line -- or add /P so that the program pauses after each page of names. You may restrict SRDEMO to consider file names that match a wildcard pattern. SRLIB can handle zeros and/or spaces before numbers as well as long file names. These file names will be introduced with Windows 95. They may be up to 255 characters long and may contain spaces. Page 2 III. SRLIB Additional Licensing Rules In addition to the normal licensing rules, the following rules will assist other software developers in finding SRLIB and prohibit tools developers from using one copy of SRLIB to eliminate its future sales: 1) You must include the notice "SortRite(TM) 1.0, Copyright (c) 1995 by David M. Wincelberg (CIS: 71573,1023)" in your documentation, near your copyright notice(s). Also, display it along with your notice(s) in any program copyright display that requires user action beyond starting your program. An example is the "Help/About" menu selection. You may substitute a graphic circle-c symbol for "(c)" and display the notice on one or two lines. This notice is contained in the global character variable sr_notice[]. 2) You may not make SRLIB's routines available, directly or indirectly, for other software developers to incorporate into their program(s). For example, Microsoft may not put these routines in Windows' COMMDLG.DLL file. Appendices A. Command Line Switches A.1. SRDEMO: Demonstrates Correct Filename Sorting Entering SRDEMO /? produces the following summary of command line switches or options: SRDEMO [switches] [pattern] pattern Filename pattern (default is *.*) /P Pause after each screen of information /W Use wide display -- 5 names per line /W4 Use wide display -- 4 names per line The /W4 switch produces a display that can be included in a memo without re-formatting. A.2. ZOPEN: Creates a single or set of zero size files Entering ZOPEN /? Page 3 produces the following summary of command line switches: ZOPEN { filename | @listfile } filename A single file name listfile Name of a file containing a list of files to create, one file name per line The braces and vertical bar (|) mean that you must choose to create either a single file name or tell the program where to find a list of file names. Note that you must precede the list- file name with the at-sign (@). A.3. ZDEL: Deletes zero size files Entering ZDEL /? produces the following summary of command line switches: ZDEL filename filename A file name or wildcard pattern This option is self-explanatory. B. Other FileJockey Software Products Following is a list of current FileJockey Software products. All of the compressed files for these products have extension ZIP. In parentheses after the descriptions are the locations where the programs may be found on CompuServe and the registration/license fees. B.1. System Tools WRDGRB 1.0 -- Copies Words From DOS Screen to Command Line: No more typing words you see on the DOS screen! With WRDGRB installed, you simply press the hot-key sequence, highlight text with your mouse, and left click to copy it to the command line (or right click to cancel). WRDGRB even connects a filename to its extension when both are highlighted in a directory listing. Pentium safe 42K TSR. No known bugs. GO SWREG (#5571) to register on-line. (GO PCUTIL, Library 3, $25) Page 4 LISTRS 1.0 -- Directory/Program List Makers With Action Options: DIRLIST: More accurate than "dir *." Options include show files, change to and remove directory. PROGLIST: Shows current directory's .EXE, .COM and .BAT files in one listing to help you find the name of the program file to run. Options include type & run, type & wait and view/edit .BAT files. Both programs correctly sort numbers within filenames. Pentium safe. No known bugs. (GO PCUTIL, Library 5, $10) B.2. Programmer Tool PROGCR 1.0 -- Prepares Programs for Copyrighting: Protects the privacy of your C/C++ or PASCAL source code copyright deposit by removing comments after each file's header (which should primarily consist of your copyright notice) from copies of the original files. Also, copies words displayed by standard or user-specified print commands to a file for spell checking. Pentium safe. (GO PCPROG, Library 6, $10) B.3. BBS-Session Tools CFWRAP 1.1 -- Word Wrapping Tuned for BBS Capture Files: Prepares BBS capture files for editing by removing page pause lines ("Press for more !", etc.) and word-wrapping various types of paragraphs (including each line starting with ">>" and indented paragraphs). Many page pause lines are in a user- changeable .INI file. Version 1.1 improvements include multi-BBS support and better word wrapping. Pentium safe. (GO PCCOM, Library 2, $15) FRMDSK 1.0 -- Enters Text From Disk With Line Preview & Edit: Use FRMDSK when a BBS requires you to type in lines instead of allowing you to upload a file. It copies lines from a file to your BBS software (or other program) after giving you options. These options include edit line, finish file, wait, cancel, next/previous line and another file. Works only with DOS text programs that read the keyboard in the standard way. Pentium safe 66K TSR. (GO PCCOM, Library 2, $15) Page 5 C. License Agreement This is a legal agreement between you ("Licensee") and FileJockey Software ("Licensor"). Licensor owns all worldwide rights, title, copyright and other interests in and to the computer program identified as SRDEMO 1.01 ("Software"). By using the Software, you are agreeing to be bound by the following terms: 1. Licensor grants to Licensee the non-exclusive and non- assignable right to use the Software without paying a fee to Licensor. 2. Licensee may distribute copies of the Software and related files to others provided Licensee informs the recipients that the Software is subject to a license agreement. 3. Licensor hereby alerts Licensee that the Software and accompanying documentation are provided "AS IS" without warranty of any kind. Licensee assumes all risks involving use of the Software and its results and performance. 4. Licensee hereby acknowledges that Licensor bears no responsibility or liability which may arise or result from Licensee's use of the Software. Licensee hereby waives and releases Licensor from any and all claims for damages, losses and costs therefrom. In no event shall Licensor's liability for any damages ever exceed the price paid for license and registration, regardless of the form of the claim. 5. This license agreement shall be construed and enforced in accordance with the laws of the State of California. This agreement may not be modified except by written instrument signed by both parties. If any provisions of this agreement are found to be invalid or unenforceable by the operation of the law, then invalidity or unenforceability of such provision(s) shall not affect the validity or enforceability of the other provisions of this agreement. Any dispute arising from this agreement shall be submitted to California courts located in Los Angeles County, and Licensee hereby submits to the jurisdiction of such courts. All (registered) trademarks and (registered) service marks are properties of their respective companies. Page 6