A procedure can also return a value, and be used as a function within expressions.
PROCEDURE Min(x, y); BEGIN IF x < y THEN RESULT := x; ELSE RESULT := y; END; END Min; .... Val := 10 * Min(0, i);
To achieve this functionality, RainCode declares an implicit local variable, called RESULT, that will hold the return value of the procedure. As all other RainCode variables, it is initialized with VOID.
RainCode makes no distinction between procedures that do take advantage of this ability and those that don't. Calling a procedure that does not return anything (understand, that never assigns any value to RESULT) from within an expression will return VOID, and more than likely, cause a type-mismatch runtime error.
Similarly, calling a procedure that does return a value as a stand-alone procedure will simply discard the resulting value.