#COMPILE EXE "s23_dynamic_array.exe"
' Sample: Dynamic arrays with REDIM
FUNCTION PBMAIN() AS LONG
    DIM d() AS LONG, i AS LONG, n AS LONG
    n = 8
    REDIM d(n) AS LONG
    PRINT "Dynamic array of"; n+1; "elements:"
    FOR i = 0 TO n
        d(i) = i * i
        PRINT "d("; i; ") ="; d(i)
    NEXT i
    ERASE d()
    FUNCTION = 0
END FUNCTION
