// STUB EXAMPLE
REM the following program works out the surface area of a cylinder
DECLARE SUB circ (radius)
DIM SHARED area AS SINGLE
DIM SHARED perimeter AS SINGLE
DIM radius AS SINGLE
DO
INPUT "Please enter the radius of the cylinder"; radius
INPUT "Please enter the length of the cylinder"; length
CALL circ(radius)
surfarea = 2 * area + perimeter * length
PRINT "The surface area is "; surfarea
INPUT "Do you want to do again? (Y/N)"; again$
LOOP UNTIL UCASE$(again$) = "N"
END
SUB circ (radius)
area = 30
perimeter = 10
END SUB
// In the first example above, the sub program “circ” has not yet been complete, so some (arbitrary) values are return from the sub program, so that the rest of the program can be tested (e.g. the surface area formula for a cylinder). “circ" is therefore acting as a stub.