SizeOf Function?

Is there a similiar function in VB to the SizeOf() function in C. I want to find the size in bytes of various variables I have in my program.

Is there something similiar to:

mySize = SizeOf(myVariable) ????????

Thanks.

Comments

  • : Is there a similiar function in VB to the SizeOf() function in C. I want to find the size in bytes of various variables I have in my program.
    :
    : Is there something similiar to:
    :
    : mySize = SizeOf(myVariable) ????????
    :
    : Thanks.
    :
    It's Len()
    dim i as integer
    dim l as long

    len(i)=2
    len(l)=4
  • : : Is there a similiar function in VB to the SizeOf() function in C. I want to find the size in bytes of various variables I have in my program.
    : :
    : : Is there something similiar to:
    : :
    : : mySize = SizeOf(myVariable) ????????
    : :
    : : Thanks.
    : :
    : It's Len()
    : dim i as integer
    : dim l as long
    :
    : len(i)=2
    : len(l)=4
    :

    LenB might be better. It returns the actual number of bytes the variable takes up.

    Dim t As String
    t = "Hi!"
    Len(t) = 3
    LenB(t) = 6 'Strings are unicode
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories