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