' Fixed arrays as TYPE fields and SIZEOF
#COMPILE EXE
#DIM ALL

TYPE Matrix
    rows AS LONG
    cols AS LONG
    data(100) AS LONG
END TYPE

TYPE Buffer
    id AS LONG
    bytes(64) AS BYTE
END TYPE

FUNCTION PBMAIN() AS LONG
    LOCAL m AS Matrix
    LOCAL b AS Buffer
    LOCAL i AS LONG

    m.rows = 10
    m.cols = 10
    PRINT "SIZEOF(Matrix):"; SIZEOF(m)
    PRINT "SIZEOF(Buffer):"; SIZEOF(b)

    b.id = 255
    FOR i = 0 TO 63
        m.data(i) = i * 10
    NEXT i

    m.data(0) = 1
    m.data(1) = 2
    m.data(99) = 100

    PRINT "Matrix rows:"; m.rows
    PRINT "Matrix cols:"; m.cols

    PRINT "TYPE array field operations complete."

    FUNCTION = 0
END FUNCTION
    PRINT "Buffer bytes(0)+bytes(63):"; total
    PRINT "SIZEOF(Buffer):"; SIZEOF(b)

    PRINT "TYPE array field operations complete."

    FUNCTION = 0
END FUNCTION
