#COMPILE EXE "s88_realloc.exe"
' Sample: REDIM PRESERVE for resizing
FUNCTION PBMAIN() AS LONG
    DIM arr() AS LONG, i AS LONG
    REDIM arr(3) AS LONG
    FOR i = 0 TO 3
        arr(i) = i * 10
    NEXT i
    PRINT "Original array:";
    FOR i = 0 TO 3
        PRINT arr(i);
    NEXT i
    PRINT
    REDIM PRESERVE arr(5) AS LONG
    PRINT "After REDIM PRESERVE:";
    FOR i = 0 TO 5
        PRINT arr(i);
    NEXT i
    PRINT
    ERASE arr()
    FUNCTION = 0
END FUNCTION
