Eiffel and hexadecimal 
Author Message
 Eiffel and hexadecimal

I need to do some ASCII to EBCDIC character translation. In the table that
I have states hexadecimal values.
Searching in ETL, I cannot find any way to specify integral values using
hexadecimal.
E.g. something like:
...
...
c : CHARACTER
i : INTEGER
...
c := '%/0xFF/'
i := 0x12AB
...

Do you have ideas to circumvent this missing (?) feature ?

Thanks,
Silvio



Sun, 14 Nov 1999 03:00:00 GMT  
 Eiffel and hexadecimal

Quote:
Silvio Calissi writes:
> I need to do some ASCII to EBCDIC character translation. In the table that
> I have states hexadecimal values.
> Searching in ETL, I cannot find any way to specify integral values using
> hexadecimal.
> E.g. something like:
> ...
> ...
> c : CHARACTER
> i : INTEGER
> ...
> c := '%/0xFF/'
> i := 0x12AB
> ...

> Do you have ideas to circumvent this missing (?) feature ?

If you are using TowerEiffel, you can write integral values in hex with
a trailing X (e.g. "i := 12abX").

Otherwise, I think you just have to translate them by hand, or find an
EBCDIC table that uses Decimal, or use a calculator that can convert
decimal<->hex (e.g. the one that comes with Windows).

Regards,
Roger
--
--
-- Roger Browne, 6 Bambers Walk, Wesham, PR4 3DG, UK | Ph 01772-687525
-- Everything Eiffel: http://www.eiffel.demon.co.uk/ | +44-1772-687525



Sun, 14 Nov 1999 03:00:00 GMT  
 Eiffel and hexadecimal

Quote:

> Silvio Calissi writes:

> > I need to do some ASCII to EBCDIC character translation. In the table that
> > I have states hexadecimal values.
> > Searching in ETL, I cannot find any way to specify integral values using
> > hexadecimal.
> > E.g. something like:
> > ...
> > ...
> > c : CHARACTER
> > i : INTEGER
> > ...
> > c := '%/0xFF/'
> > i := 0x12AB
> > ...

> > Do you have ideas to circumvent this missing (?) feature ?

> If you are using TowerEiffel, you can write integral values in hex with
> a trailing X (e.g. "i := 12abX").

> Otherwise, I think you just have to translate them by hand, or find an
> EBCDIC table that uses Decimal, or use a calculator that can convert
> decimal<->hex (e.g. the one that comes with Windows).

What about a function that does the conversion (to_hex(hex : STRING): INTEGER)
that is used inside a once-routine to return the needed conversion table?
Yes, slow and long, but portable and clean. I solved the problem using an
external C function...

Ulrich



Tue, 16 Nov 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. converting hexadecimal string to 64 bit hexadecimal number

2. Hexadecimal Field Separator

3. Parsing hexadecimal in AWK?

4. hexadecimal number

5. How to Convert Hexadecimal Input to Decimal??

6. Processing hexadecimal data

7. Hexadecimal to decimal converter

8. hexadecimal to decimal converter in awk

9. Hexadecimal numbers

10. "hexadecimal characters" in ST.

11. reading hexadecimal numbers

12. Hexadecimal input formating picture

 

 
Powered by phpBB® Forum Software