However, the $web value is not cleared.
Local variables (prefixed with a single $) are script-specific. A script can only clear its own local variables. If you have declared a local $web variable when no script was running, then no script can clear it.
Thank you very much.
If you want a variable to available to the layout or other scripts, use a global variable. A Global variable starts with $$. If you have FileMaker Advanced, you can see the current Variables in the Dataviewer. If you are going to be doing developement, I highly recommend investing in FileMaker advanced. The data viewer and debugger are indespensible.
Thanks so much.