Use the func command to set the current procedure or function to function. If you do not specify a procedure or function, func prints the name of the current function.
Changing the current function causes the file containing it to be displayed in the source window; this file becomes the current file. The scope pointer (-) in the line-number region moves to the current function to indicate the beginning of the new scope that Prism uses in identifying variables.
Invoking func with an invalid function name leaves the scope pointer unchanged.
The func command causes the function frame to be set to the first instance of the specified function, if any, on the expression stack. For example, assume that the function on the top of the stack, function bar, is not optimized. All of bar's local variables are accessible. Issuing the Prism command:
func foo
causes foo to become the first instance of foo on the stack. If foo is optimized, then the only accessible variables are global variables. No local variable of foo is accessible and none of the local variables of function bar are visible (because of scope change) so none of bar's variables are accessible. In other words, variables that were previously accessible are no longer accessible after issuing the command:
func foo.
The set of accessible variables is a subset of the set of visible variables.