' TYPEDEF for base types and PTR types
#COMPILE EXE
#DIM ALL

TYPE Person
    name AS STRING
    age AS LONG
END TYPE

TYPEDEF MyLong AS LONG
TYPEDEF TPerson AS Person

FUNCTION PBMAIN() AS LONG
    LOCAL ml AS MyLong
    LOCAL p AS TPerson
    LOCAL n AS STRING

    ml = 42
    PRINT "MyLong value:"; ml

    p.name = "Bob                    "
    p.age = 25
    n = p.name
    PRINT "TPerson name:"; TRIM$(n)
    PRINT "TPerson age:"; p.age

    PRINT "SIZEOF(MyLong):"; SIZEOF(MyLong)

    PRINT "TYPEDEF operations complete."

    FUNCTION = 0
END FUNCTION
