' Percent Equates — %identifier = value numeric constants
#COMPILE EXE
#DIM ALL

CONST MAX_ITEMS = 100
CONST BUFFER_SIZE = 4096
CONST FLAG_READ = 1
CONST FLAG_WRITE = 2
CONST FLAG_EXEC = 4
CONST FLAG_ALL = FLAG_READ OR FLAG_WRITE OR FLAG_EXEC
FUNCTION PBMAIN() AS LONG
    LOCAL buf(100) AS LONG
    LOCAL mode AS LONG

    mode = FLAG_READ OR FLAG_WRITE

    PRINT "MAX_ITEMS = "; MAX_ITEMS
    PRINT "BUFFER_SIZE = "; BUFFER_SIZE
    PRINT "FLAGS: READ="; FLAG_READ; " WRITE="; FLAG_WRITE; " EXEC="; FLAG_EXEC
    PRINT "Combined mode = "; mode
    PRINT "ALL flag = "; FLAG_ALL

    buf(1) = 42
    PRINT "buf(1) = "; buf(1)

    FUNCTION = 0
END FUNCTION
