Example 5: Writing to STDERR

The following code implements a simple user function to write messages to the stderr stream:

FUNCTION to_stderr(s)
   DEFINE s STRING
   DEFINE c base.Channel
   LET c = base.Channel.create()
   CALL c.openFile("<stderr>", "w")
   CALL c.writeLine(s)
END FUNCTION