If ServerUpdate “false” is invoked in a procedure and for some reason it’s not deliberately set back to “true”, is updating re-established when the procedure ends?
I’m not sure what you’re working on, but ServerUpdate “off” always reverts to “on” after a procedure is complete. At least it did in Panorama 6/Enterprise.
In Pan 6 I also found that I needed to set it Off, or False, multiple times in some procedures in order to get it to stay off until the procedure ended. So I would prefer to know if the intent is that it takes care of itself if I somehow fail to.
Based on the Panorama X source code, it is intended that serverupdate is always enabled when all running procedures are complete, or when the active window changes.
Note that it’s “all running procedures are complete”, not “the procedure that disabled serverupdate is complete”. Let’s suppose procedure Alpha calls procedure Beta, then procedure Beta disables serverupdate and doesn’t turn it back on again. It will remain off until procedure Alpha finishes (unless the code in Alpha explicitly turns it off).
Also, suppose you have code like this:
serverupdate "off"
window "Any Other Window"
// serverupdate is back ON AGAIN!!!
I’m not sure if Panorama 6 did the same thing, but perhaps that’s why you needed to set it off multiple times.
In general, you should leave serverupdate off the absolute minimum time necessary.
I just experienced an instance where ServerUpdate “Off” seemed to turn back on after a Wait 0. Is that because Wait 0 effectively means that “all running procedures are complete”? Or am I missing something?
Also, does “switching to a different window” include displaying a Message or an Alert?
Is that because
Wait 0effectively means that “all running procedures are complete”?
I wouldn’t phrase it that way, but then I wouldn’t say that was wrong either.
The wait statement probably doesn’t work the way you think it does. You are probably imagining that it is somehow “pausing” the procedure, but that’s not how it works. Instead, what is really happening is that the current procedure ends immediately, and a timer is set to restart the procedure later, but starting not at the beginning, but at the point just after the wait statement.
So during the wait time, there is no procedure running, i.e. “all running procedures are complete”. So yes, this will have the side effect of turning ServerUpdate back on if it was off.
Side note: I’m wracking my brain trying to think of a scenario where I would want to use both serveruptate “off” and “wait” in the same procedure. Perhaps a lack of imagination, but I cannot think of any reason why I would ever want to do that, especially if the wait statement is in the middle of the code. Are you sure that the use of wait 0 is appropriate in your code?
does “switching to a different window” include displaying a Message or an Alert?
I’m really not sure.
Keep in mind that turning off server updates is intended to be something very temporary. In my opinion, turning updates back on immediately would be the best practice. Don’t wait for Panorama to automatically turn updates back on for you.