When the function is done running, the variables in the workspace vanish, as with any computer program. If you want to see what they are, make it a script by getting rid of the function line, and the final end statement. Or, you can put a breakpoint at the very last statement (pause).
Why would the script be displaying anything? Go through the script and make sure there are no calls to DISP, and every line ends in a semi-colon. Then the script shouldn't be dumping anything to the command line.
Best Answer