Shop OBEX P1 Docs P2 Docs Learn Events
Hex Dec Ascii converters — Parallax Forums

Hex Dec Ascii converters

ArchiverArchiver Posts: 46,084
edited 2003-04-14 15:42 in General Discussion
Does anybody have a good reference or two to hex<>dec<>ascci
converters for the Basic stamps??

Thanks,

Brent

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-04-14 15:42
    Internally, there is no storage format -- values are values. When you want
    to display, you must convert a value to an ASCII string that represents that
    value. Luckily, formatting conversion is built into PBASIC. Try this little
    demo (you'll need to latest compiler -- available in beta from our web site):

    myNum VAR Word

    Main:
    DEBUG "Enter a number: "
    DEBUGIN myNum

    DEBUG CR, CR
    DEBUG "Decimal... ", DEC myNum, CR
    DEBUG "Hex....... ", IHEX myNum, CR
    DEBUG "Binary.... ", IBIN myNum, CR
    END


    I added "I" in front of the HEX and BIN modifiers to display the '$' and '%'
    indicators.

    -- Jon Williams
    -- Parallax

    In a message dated 4/14/2003 9:36:00 AM Central Standard Time,
    broyles@i... writes:

    > Does anybody have a good reference or two to hex<>dec<>ascci
    > converters for the Basic stamps??



    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.