How to pass a variable to a function?

Which leads back to my original question - how do I get the Function to "see" the StringBuffer variable in the main loop?

Which leads back to my second reply.
Specify the type and the name of the variable in the function definition's argument list.

(I'm bored asking to see all of your code now, so I won't do it again)