Some of you may be wondering why this trick is necessary. Changing the display is an expensive (i.e. slow) operation. It needs to be minimized to keep Panorama as fast as possible.
When you run the showvariables statement, Panorama scans every object in every open form window to see if the object formula contains that variable. If forms contain a lot of objects, that becomes a fairly complicated slow operation. That’s why this isn’t done every time a variable value changes. Instead, it is only done “on command” when showvariables statement runs.
In order for your example to work without any extra trick, Panorama would have to check all form objects looking for the info(“globalvariables”) function every time a global variable was added or removed. That would be super slow! And thats just one info( function, there are nearly a hundred. And there are hundreds of other functions you might put in formulas that would need the same logic. This would be insanely complicated, would slow down all Panorama code considerably, and for a quite rare situation.
Since this is a rare situation, no specific feature was added to Panorama to handle it. Instead, you just put in a fake variable, and use the standard showvariables statement to trick Panorama into displaying whatever you want. Dave and my solutions are just two different ways to include a fake variable in Panorama X. (This same trick used to work in Panorama 6, but you had to set up a real variable with empty text in it. You can still do that, but it’s an extra step. Though it makes the formula simpler, you don’t have to use ignore( or catcherror( if you actually set up a variable with empty text.)