Quote:Mark,
Can you tell me if repeatedly saving to a GlobalValue in a loop, will run as fast as doing the same with a static variable?
Or, does the GlobalVariable need to be written to disk with each update?
A Global Value is going to much slower than using a static global variable. A Global Value is a stored in your application permanently, so it must be conveyed to the application server (possibly through a network), and will be stored in the application file (.db and .dat). Additionally, because it is a keyed value, the system will have to look through the list of Global Value keys to find the matching key, which will also take time that a static global variable does need to do.
Unless the value needs to be stored with the application permanently, or needs to be communicated between forms, or between clients, you would be better served by a static global variable. A static global variable will only retaiin its value while the form is still active. Its scope is limited to the code attached to the same form, so it can't be used for inter-form communication. And it is limited to the client that ran its declaration. But because it is otherwise a normal variable, it is stored in RAM on the client, and needs no lookup of any kind. This makes it many times faster than either an element or a Global Value, probably several thousand times faster.