Newbie Tooltip Variable undefined

In this snippet:
image
Tooltips tell the value of the parameter TargetLocIn.
The log tells the value of the local variable TargetLoc.
How can I see the value of the local variable TargetLoc with toootips?

Adding “local TargetLoc” allowed toolttip to show the local variable’s value.
So, that’s the answer.
Is there maybe another answer?

Script Debugger requires local variables to be explicitly declared using a local statement or be a loop control variable in a repeat loop. You must also be paused within the handler for local variables to have their value.

Search the Script Debugger. Help book for variables to find more guidance on how to make the best use of Script Debugger’s debugging facilities.

Thanks! That’s clear now.

Just to be extra clear, local variables in handlers don’t need to be declared to function, but only if you want to see their value while in debugging mode.