Re: Code Review - is this code ***
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Fri, 31 Jul 2009 08:29:12 +0000
spinoza1111 said:
On Jul 31, 12:47 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx>
wrote:
spinoza1111said:
<snip>
Does it allow strings to be compared for greater-than and
less-than,
Yes, and the results will depend on the basic character set. Thus,
for example, if you sort a collection of strings on two different
systems that use different character sets, you will get different
orderings.
In other words, a bug.
Only if the program specification requires the ordering to be the same
despite the character set differences. To meet such a program
specification would obviously require different string handling. If
it ever happens, which it hasn't yet, I'll take that into account and
react accordingly.
and if so, how does it handle different results for EBCDIC
environments?
The purpose of sorting is to facilitate searching. Searching needs
to be done using the same assumptions that were made during
sorting. Therefore, before searching through data, one should
ensure that it is sorted according to the assumptions one will use
in the search. Thus, if you are searching on the assumption of
EBCDIC ordering, you should ensure that the data is sorted using
EBCDIC ordering. If your "sorted" file has come from an external
environment that might be ASCII, simply sort it before searching
it. Easy.
This means that if the user uses your code to sort on a mainframe
and searches it on his PC, he will get erroneous results, and you
will tell him, tough luck.
If he's using the PC as a thin client to a mainframe session, he'll
get the right results without having to re-sort. If he transfers the
file to the PC, he will need to perform any necessary conversions to
the data to make it work on the PC; that includes converting the data
from EBCDIC to ASCII (if the transfer program does not do this for
him), and re-sorting any sorted data, just as he would have to do for
any other report produced by a mainframe and transferred to a PC.
What part of "unprofessional" don't you understand?
Mu.
<snip>
Thus what you understand as a "character" is something that can be
represented in 8 or even 7 bits.
CHAR_BIT bits.
<snip>
C Sharp, Java and even Visual Basic simply don't have this problem.
You've managed to get C Sharp and Visual Basic running on a mainframe,
have you? (I suspect Java probably /has/ been ported to the mainframe
by now, for all the good it will do...)
If you insist that a character must fit within 8 or even 7 bits,
CHAR_BIT bits.
<nonsense snipped>
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
This line unintentionally left unblank
.
- Follow-Ups:
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- References:
- Code Review - is this code ***
- From: lovecreatesbeauty@xxxxxxxxx
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Re: Code Review - is this code ***
- From: Richard Heathfield
- Re: Code Review - is this code ***
- From: spinoza1111
- Code Review - is this code ***
- Prev by Date: Re: Code Review - is this code ***
- Next by Date: Re: Code Review - is this code ***
- Previous by thread: Re: Code Review - is this code ***
- Next by thread: Re: Code Review - is this code ***
- Index(es):