' MACRO/END MACRO, MACROFUNCTION, MACROTEMP
#COMPILE EXE
#DIM ALL

MACROFUNCTION Square(n) = (n) * (n)

MACROFUNCTION Cube(n) = (n) * (n) * (n)

MACRO MaxOf(a, b, result)
    IF (a) > (b) THEN
        result = (a)
    ELSE
        result = (b)
    END IF
END MACRO

FUNCTION PBMAIN() AS LONG
    LOCAL x  AS LONG
    LOCAL y  AS LONG
    LOCAL sq  AS LONG
    LOCAL mx  AS LONG
    LOCAL cube  AS LONG
    x = 5
    y = 8

    sq = Square(x)
    PRINT "Square(5):"; sq

    MaxOf(x, y, mx)
    PRINT "MaxOf(5,8):"; mx

    cube = Cube(3)
    PRINT "Cube(3):"; cube

    PRINT "MACRO operations complete."

    FUNCTION = 0
END FUNCTION
