Howdy, Stranger!

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

Categories

SizeOf Function?

xeifrankxeifrank Member Posts: 55
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

  • paulj59paulj59 Member Posts: 420
    : 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
  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : : 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
  • Andre YoungAndre Young USAMember Posts: 0

    ________ | http://forcoder.org | free ebooks and video tutorials about < Python Go Visual Basic JavaScript Swift C++ Scratch R Perl Objective-C C PL/SQL C# MATLAB Assembly Ruby Delphi Visual Basic .NET Java PHP FoxPro Prolog Fortran Awk F# Scala ML Hack COBOL Scheme Apex Lisp Ada ABAP Logo Julia Rust Crystal Kotlin Bash Transact-SQL LabVIEW Dart D Alice VBScript Clojure Lua Erlang SAS /> _____________

Sign In or Register to comment.