VariableDestroyAll
When used in conjunction with
Average rating: 4.4 (30 votes) Log in to vote
Jonathan Mickelson - Show more from this author |
$$GlobalVarList|0
$$testVar|34
$$AgeTemp|7
$$GlobalVarList
$$testVar
$$AgeTemp
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Requires FileMaker 8 or higher.
Removes all global variables listed in $$GlobalVarList, including $$GlobalVarList. If used properly, this can insure a file has no Global variables in use any more.
NOTE: Should be used in conjunction with the CF "VariableInitialize ( name ; initialValue )", which maintains a list of all variables initialized in a file in another variable named $$GlobalVarList.
Comments
Rich, Lewiston, ID, USA May 22, 2017 |
||
Forgive my ignorance, but I'm scratching my brain raw figuring out how to implement this (and its companion) custom function. Let's say there are three global variables ($$_Alpha, $$_Bravo, $$_Charlie) that I want to null in a script using this technique. How do I set it up, not knowing what the variable's contents are (since they'll change as a loop function is called)? TIA for your help. |
||
Jonathan Mickelson May 22, 2017 |
||
This function only removes variables it knows about because their names live in a variable called $$GlobalVarList... Which is what the other companion function does, it creates the variable and logs it to that variable. You could easily write a function that takes a list of variable names, as teext, and clears them all in one fell swoop. It would either be recursive, or substitute the evalates clearing similar to my functions. A great custom funtiin is CustomList, Google it. It's tremendous, and does it's majic non recursively!! Good luck!!! |
||
L. Allen Poole, Creative Database Solutions NW Jan 21, 2021 |
||
https://community.claris.com/en/s/idea/0870H000000kAwKQAU/detail | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.