' DATA/READ Basic — Reading data from DATA statements
#COMPILE EXE
#DIM ALL

DATA 10, 20, 30, 40, 50

DATA 1.5, 2.5, 3.5

FUNCTION PBMAIN() AS LONG
    LOCAL i AS LONG
    LOCAL sum AS LONG
    LOCAL val AS LONG

    PRINT "Reading DATA values:"

    FOR i = 1 TO 5
        READ val
        PRINT "Value "; i; " = "; val
        sum = sum + val
    NEXT i

    PRINT "Sum = "; sum

    FUNCTION = 0
END FUNCTION
