A 'LOGICAL' SORT These tested patterns provide a method to order entries in a data- base or word processing environment in a desired manner. 'Well, isn't that what a database is for?', you ask. Yes and No. Where material is desired to have seperate sections within a database itself this relatively simple method takes the pain out of a lot of programming that would usually be employed to do the job. Are there other ways? - Sure, I guess. How does it work? Using the sequences below segregates a database into two basic areas based on including them as the first or 'key' field in a prescribed sort. The first 'section' (entries that will appear at the top) is composed of records in which NO entry (a 'null') has been made in the 'key' field. This is also the prime area where real sorting will occur. As the 'key' fields are all identical, sorting defaults to the next chosen field - the real data. The second 'section' encounters the sequences in the 'key' field and organizes around them. This area could be used for things such as a Table of Contents etc. ... As currently designed this will provide up to 1073 reserved records using one key field of two text characters in length. note: by using the same seguence of codes in a second 'field' these can be resued thus extending the range of reserved area. e.g. by setting the first or 'key' field to '0' and using the 1073 combinations in the second field and then changing the key field to "00" (i.e. following the same pattern below) you can reuse the entire sequence again in the second field for another 1073 entries. Changing the key field to '01' gets another 1073 entries and so on for 1073 total passes. This produces over one million possible entries using only two fields of two text characters each (or one four character field ; just don't forget the 'space' after any 'single' leading code; e.g. "0 z"). The Sorting Sequences Alpha/Numeric (these will appear above alphabetical only) "0" then "00"-"09" then "0a"-"0z" (total 37) -- "1" then "10"-"19" then "1a" - "1z" (total 37) -- "2" then "20"-"29" then "2a"-"2z" (total 37); use this section for Level 1 World Menu area ....and so forth for 3-9z; i.e. 10 sets of 37 = 370 reserved records. (if we limit it to 0a - 9z (26 times 10) = 260 reserved records) -- Alphabetical only: "a" then "aa"-"az" (total 27) then "b" then "ba"-"bz" (total 27) ... Following the same pattern: next letter 'c' followed by next ca-cz through end of alphabet gets 26x27= 702 alfa only reserved records. If we limit to dual alpha only (aa-zz) we get 26 sets of 26 pairs or 676 reserved records. Further : limited sets from each type = 260 + 676 = 913 records with a total of 913x913= a big bunch if codes are used in two fields (which can be combined into one field if so desired; it just seems easier at the planning stage to think in descrete limited terms) Using the non-limited: 702+371=1073 or 1073x1073 using two fields. Another variation: use a limited triple-alpha sequence in a three character field (e.g. aaa-zzz) = 26x26x26 = 17,576 records a aa aaa - aaz (28 records) aba - azz (25x26) b - zzz (25x26x26) HOPEFULLY ONE OF THESE IS ENOUGH. (if not: add another field or more width and due the math.) One final note: data transfered to a word processor sorts the same when the sort is limited to each area seperately. i.e. where a (no entry) is used as opposed to the codes above. Keep them seperate in a word processor. The sort sequence: Key Field1 + Key Field2 (if used) + any chosen field(s) for the primary sort area. A.J. Ward Dec. 20, 2000 (c) 2000