Announcement

Collapse
No announcement yet.

Sizeof and array of types

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Peter P Stephensen
    replied
    Code:
    #Compile Exe
     
    Type MyType
         x As Long
         y As Double
    End Type
     
    Function PbMain
     
        Dim mt(10) As MyType
     
        SizeOfArray& =  SizeOf(mt(0))*(UBound(mt())-LBound(mt())+1)
     
        MsgBox Format$(SizeOfArray&)
     
    End Function
    Regards
    Peter


    ------------------

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Sizeof and array of types

    Sizeof and array of types

    What is the statement to return the size of an array of types ?
    I looked in the docs, but I can't find anything about it.

    Anyway I need it for the WSAIoctl function where one parameter is the array of types and another is the size of the array.
    I'm porting it from C and there the function sizeof(arrayname) is used. This statement gives an error message in pbdll.

Working...
X