[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with 64-bit numbers



>  Date: Sat, 20 Apr 1996 07:18:44 -0400 (EDT)
>  From: Michael Griebling <grieblm@inforamp.net>
>  ...
>  >No problem. What do you and the rest prefer? A WriteHex... method
>  >for all the basic types, a subset with the more useful ones or a
>  >very basic capability like
>  >
>  >    PROCEDURE (w: TextWriter) WriteHexBytes(val: ARRAY OF SYSTEM.BYTE);
>  
>  >I don't mind writing all of them (the module TextRiders, in which a
>  >TextWriter is defined is completely portable across all systems, so
>  >will have to be written only once).
>  
>  No need to get elaborate.  The above WriteHexBytes procedure would be
>  fine for my needs.  I'm assuming it would output as many hex digits as
>  indicated by the LEN of val?

There is still the byte-order issue.  I suggest to write the bytes as
they appear in `val' (not that you have another choise if you can pass
records, arrays, LONGINT, etc to it).  This way you have different
output for little and big endian machines, but you don't have to
introduce the concept of byte-ordering into TextRiders (it should only
be relevant for BinaryRiders).

>  >Another possiblity which Michael v Acken and I discussed was to define
>  >a separate module HexRiders as a subclass of TextRiders. Anyone that
>  >likes this idea.
>  
>  Overkill.

Definitely.