Local Variable Question

With a global variable, you can set it to a value of zero if the value has not been set:

:if ([:typeof $pingFailure] = “nothing”) do={:set pingFailure 0}

How do you do this with a local variable?

You check if exist or not for global scope, but locally you must set it to “” at the start of the script.

Got it. So, if you have a script that will run every 5 minutes, and ping a device until it has 5 bad pings, you would have to use global variables, because each time the script runs, the local variable gets erased. Is that correct?

Is correct, and is not correct…

Depend on how you write the script…

In this case I prefer netwatch…