The following always shows 0 :
var gNumber = 0;
function myTest() {
Browser.msgBox(gNumber);
gNumber++;
}
I can, of course, use ScriptProperties or UserProperties to store a value permanently. Fine for simple values but it will not work for an object unless I stringify it. But with the latter, I cannot store permanently an object that opens a sheet and lets me manipulate it via methods (get, set).
I have an Orders spreadsheet that uses information from the Customers spreadsheet. Everytime I check an order, I need to open the Customers spreadsheet and load its data into an array. Is there a way to keep an object permanently so that I don't need to open Customers over and over again?
By permanently, I mean as long as the sheet associated with the script is open!
Is there a way I can do that?