1. Hex writing doesn't work?

Thanks Bernie and Lucius for answering my question, but I'm afraid
that I use that answers.
Bernie, your's print the number like a string, and I want to write a
hex number to make an string.
And Lucius answer doesn't work =(

Any other solution?

--
Best regards,                            ICQ Number: 3198249
 Caballero Rojo                          mailto:pampeano at rocketmail.com



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

new topic     » topic index » view message » categorize

2. Re: Hex writing doesn't work?

On Sun, 23 Apr 2000 23:20:06 -0300, Caballero Rojo
<pampeano at ROCKETMAIL.COM> wrote:

>Thanks Bernie and Lucius for answering my question, but I'm afraid
>that I use that answers.
>Bernie, your's print the number like a string, and I want to write a
>hex number to make an string.
>And Lucius answer doesn't work =(
>
>Any other solution?

Your description is unclear, but I think I understand... :)

I think you're wanting to do this:
    #4E23  as a number --> "4E23" as a string, without printing it.

For this you need the sprintf() function (notice the extra 's')
Then you can do this:
    sequence hexstring
    integer  hexval
    hexval = #4E23
    hexstring = sprintf("%04x", hexval)

I don't even need to write a function this time. :)

Hope this is what you wanted,
Carl

--
Carl R. White       - Software Tester @ CTD - Carl- at -comodo.net
Cyrek the Illogical -          Geek         - cyrek- at -bigfoot.com
         Remove hyphens before mailing s'il vous plait...

new topic     » goto parent     » topic index » view message » categorize

3. Re: Hex writing doesn't work?

Hello Carl,
      I don't speak english very well, so I couldn't explain it better
      :(
      Anyway, the solution was using puts. :)
      Thanks.

--
Best regards,                            ICQ Number: 3198249
 Caballero Rojo                          mailto:pampeano at rocketmail.com

Tuesday, April 25, 2000, 9:16:35 AM, you wrote:

CRW> Your description is unclear, but I think I understand... :)

CRW> I think you're wanting to do this:
CRW>     #4E23  as a number --> "4E23" as a string, without printing it.

CRW> For this you need the sprintf() function (notice the extra 's')
CRW> Then you can do this:
CRW>     sequence hexstring
CRW>     integer  hexval
CRW>     hexval = #4E23
CRW>     hexstring = sprintf("%04x", hexval)

CRW> I don't even need to write a function this time. :)

CRW> Hope this is what you wanted,
CRW> Carl

CRW> --
CRW> Carl R. White       - Software Tester @ CTD - Carl- at -comodo.net
CRW> Cyrek the Illogical -          Geek         - cyrek- at -bigfoot.com
CRW>          Remove hyphens before mailing s'il vous plait...



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu