Announcement

Collapse
No announcement yet.

Sizeof and array of types

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

    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.


    #2
    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


    ------------------
    [email protected]
    www.dreammodel.dk

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎