' Pointer and address functions: VARPTR, STRPTR, CODEPTR, SIZEOF
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL x AS LONG
    LOCAL s AS STRING
    LOCAL p AS LONG

    x = 42
    s = "Hello PBXB64"

    p = VARPTR(x)
    PRINT "VARPTR(x):"; p
    PRINT "SIZEOF(x):"; SIZEOF(x)

    p = STRPTR(s)
    PRINT "STRPTR(s):"; p
    PRINT "SIZEOF(s):"; SIZEOF(s)

    p = CODEPTR(PBMAIN)
    PRINT "CODEPTR(PBMAIN):"; p

    PRINT "SIZEOF(LOCAL AS LONG):"; SIZEOF(LONG)
    PRINT "SIZEOF(LOCAL AS BYTE):"; SIZEOF(BYTE)
    PRINT "SIZEOF(LOCAL AS STRING):"; SIZEOF(STRING)

    PRINT "Pointer address operations complete."

    FUNCTION = 0
END FUNCTION
