Author Message

I need to do some ASCII to EBCDIC character translation. In the table that
Searching in ETL, I cannot find any way to specify integral values using
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

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
> 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

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
> > 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

 Page 1 of 1 [ 3 post ]

Relevant Pages