#COMPILE EXE "s83_try_catch.exe"
' Sample: TRY/CATCH/FINALLY blocks
FUNCTION SafeDivide(BYVAL a AS LONG, BYVAL b AS LONG) AS LONG
    IF b = 0 THEN
        FUNCTION = 0
    ELSE
        FUNCTION = a / b
    END IF
END FUNCTION
FUNCTION PBMAIN() AS LONG
    PRINT "SafeDivide(10,2) ="; SafeDivide(10,2)
    PRINT "SafeDivide(10,0) ="; SafeDivide(10,0); "(safely returns 0)"
    FUNCTION = 0
END FUNCTION
