On Fri, 15 Feb 2008 06:23:47 -0500, Jerry Stuckle
<jstucklex.DeleteThis@attglobal.net> wrote:
>Bergamot wrote:
>> Beauregard T. Shagnasty wrote:
>>> using 0̸ still does not allow searches for "AB0CD".
>>
>> Then maybe the suggestion I posted using background images is better
>> after all.
>> http://www.bergamotus.ws/samples/slashed-zero.html
>>
>
>I hadn't thought of that idea - but I like it.
The suggestion may be a good one, but it really isn't needed
here.
I've written a sort that puts the callsigns in Callbook order.
All they have to do is look them up like you'd look it up in an old
paper copy of Callbook.
OK, so I'll explain the sort that I've applied to them.
A ham radio callsign anywhere in the world (with only one
exception that I've seen so far, the Australian Foundation license) is
formatted as follows: Prefix (one or two alphanumeric characters),
call district (a single numeric character), and suffix (one to three
alphabetic characters).
They are sorted in this order: call district, suffix, prefix.
Since the prefix can be one or two characters, the call
district could either be the second or third character in the
callsign. So you break it down as to how to sort it like this:
1. Check the third character in the callsign to see if it
is numeric. If it is, that is the call district. (for WB4AEJ, it
would be '4'. For W1AW, it would be 'A'. For NX7V, it would be '7'.
For AH0K, it would be '0').
2. If it isn't numeric, check the second character in the
callsign. If it is, that is the call district. If it isn't, it is
not a valid callsign (die()). For W1AW, it is now '1'. So for each
callsign, we now have:
WB4AEJ 4
W1AW 1
NX7V 7
AH0K 0
3. Take every character after the call district. If it
is less than three alphabetic characters, add '#' until you have
three. We now have:
WB4AEJ 4AEJ
W1AW 1AW#
NX7V 7V##
AH0K 0K##
4. Add the prefixes to the end. If there is only one
alphanumeric character, add '#' to the end of it. We now have:
WB4AEJ 4AEJWB
W1AW 1AW#W#
NX7V 7V##NX
AH0K 0K##AH
5. Now, we sort on the 'sort code field that we've
created. We now have:
AH0K 0K##AH
W1AW 1AW#W#
WB4AEJ 4AEJWB
NX7V 7V##NX
Now they can be displayed in Callbook order in a table on
someone's Web page.
Why use the '#' instead of a blank space? If we created those
sort codes in a field with a blank space, the database tends to
truncate them off the end of the field. The character '#' is close
enough in ASCII value to be able to stand in for the space. The
database doesn't truncate '#' from the end. And it is more easily
recognized when the table is being inspected by the naked eye
(troubleshooting, etc).
So, there is no need to search on the callsigns in the form at
all. Displaying the 'Ø' in place of the '0' is only done when it is
displayed on a browser from a Web page. If I want to set up the means
to search a callsign on my database (which I do not plan to implement
anyway), the '0' is in the database, not the 'Ø'. So the mechanism
would be easily usable.
Now I guess I've given you folks a lot more to [pardon the
pun] hash over.
Regards,
Fred
>> Stay informed about: Style Sheet Times New Roman