Example 2: Modify a StringBuffer with a function
MAIN
DEFINE buf base.StringBuffer
LET buf = base.StringBuffer.create()
CALL modify(buf)
DISPLAY "buf is ", buf.toString()
END MAIN
FUNCTION modify(sb)
DEFINE sb base.StringBuffer
CALL sb.append("more")
DISPLAY "sb is ", sb.toString()
END FUNCTION
Output:
sb is more
buf is more