Thomas (boggyb) wrote,
Thomas
boggyb

  • Mood:
  • Music:

I have a small snippet of code here, written in Visual Basic 6. Guess what it does:

Dim s As String
s = String(2, "0")
Debug.Print s

I'll give you a hint: it doesn't do what I wanted it to do.

Ok, I'm a fool. That code does what I want it to do. The following code in my program:

RSet s = Hex(1)

most certainly does not do what I wanted it to do, as it appears that RSet will replace leftover characters with spaces. Which kind of negates the whole point of padding the string with zeros in the first place. Grrr.

Tags: programming
Subscribe

  • Today's maths fail

    Today's maths fail comes courtesy of the local Tesco's - can you spot it? Using the drained weight (dr.wt) of 165g, the correct values are:…

  • StreetPass Battle maths

    So one of the extra minigames in StreetPass Mii Plaza is StreetPass Battle, wherein you defeat a succession of opposing empires in a best-of-three…

  • Hashing algorithms ≠ unique identifiers, mmkay?

    I see talismancer has just managed to sneak in a post for yesterday. I can't really mock him for that one, seeing as I did the same…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments