invalid digit "x" in octal constant

About Monkey 2 Forums Monkey 2 Development invalid digit "x" in octal constant

Tagged: ,

This topic contains 9 replies, has 6 voices, and was last updated by  Mark Sibly 1 year, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #9525

    Maff
    Participant

    Hi all,

    Being the tidy sort, I occasionally pad my input params out so all the params line up, but the in the below code:

    New Wibble(0008,1)

    Gives an error:

    I can happily pad with spaces, but is this expected behavior?

    Cheers,

     

    Maff

    #9530

    Jesse
    Participant

    Definitely a bug. Post it on GitHub. Thats the proper way to report bugs.

    #9549

    TomToad
    Participant

    Not a bug. Using a leading 0 is how you type numbers in octal with Monkey2, just like typing a leading $ for hexadecimal. I guess you will need to use leading spaces instead

    #9550

    abakobo
    Participant

    Is there a way to type binaries literals with such kind of leading symbol?

    #9553

    Jesse
    Participant

    >Not a bug. Using a leading 0 is how you type numbers in octal with Monkey2.

    Really! That’s kind of weak. It should have a symbol or something that’s different than just 0s.

    #9558

    Maff
    Participant

    Interesting, thanks 🙂 Thought it worth an ask before crying foul.

    #9562

    Mark Sibly
    Keymaster

    Definitely a bug!

    This is a horrendous C ‘feature’ that I forgot about that needs to be worked around.

    Monkey2 does not (officially) support octal notation.

    #9563

    Jesse
    Participant

    Hahaha! That’s what I thought.

    #9564

    scurty
    Participant

    I’ve dealt with Hex via StringToLong() and Utf with “hello”[1]
    Never had to deal with Octals before; I think. This would be good I presume.

    #9565

    Mark Sibly
    Keymaster

    Use StringToULong for octals too, eg: Print StringToULong( “100”,8 ) prints 64.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.