Order Tray | Contact Us | Home | SIG Lists

[aprssig] TNC command formats

scott at opentrac.org scott at opentrac.org
Thu Mar 17 14:36:41 UTC 2005


Yeah, I know it can be done.  Just didn't want to do anything ugly like
write my own case-insensitive string compare function.  When I've got a
clean, elegant bit of code that does what it's supposed to do, I hate to go
muck it up.  If an elegant way to do this occurs to me, I'll do it.

To me, a more useful function would be command history - hit the up arrow
and scroll back through the commands you entered.  That'd take a lot of RAM,
though, and would mean separate buffers for each console connection.

Scott
N1VG

-----Original Message-----
From: aprssig-bounces at lists.tapr.org
[mailto:aprssig-bounces at lists.tapr.org]On Behalf Of Bill Herrmann
Sent: Wednesday, March 16, 2005 10:29 PM
To: TAPR APRS Mailing List
Subject: Re: [aprssig] TNC command formats


At 03:25 PM 3/16/2005 -0800, Scott Miller wrote:
>match what you'd entered.  You'd get ver<tab>SION.  Not that bad, but the
>lack of a case-insensitive string compare makes it harder.  If I think of a
>clean way to do it, I'll try.

Just a vague memory here and I don't have time to look it up, but....

I'm pretty sure that in ASCII the difference between an upper case letter
and a lower case letter is a single bit (set for lower case and clear for
upper). It shouldn't be too hard to mask that bit for the compare or apply
it to the added portion of the command in order to match the case. If you
choose to try and match the case I'd suggest borrowing the bit from the
last character the user entered.
i.e. if I enter He make the resulting command Help where if you used the
first character you would get HeLP.

Bill

p.s. Careful of numbers and special characters as they don't hold up if you
muck with that bit. (Interestingly numbers, at least, do in EBCDIC.)



_______________________________________________
aprssig mailing list
aprssig at lists.tapr.org
https://lists.tapr.org/cgi-bin/mailman/listinfo/aprssig





More information about the aprssig mailing list