Brian Dunning's FileMaker Custom Functions

VariableLocalize ( GlobalVariableName )

Changes the scope of a Global variable to a Local variable of the same name, with the same contents.

  Average rating: 4.0 (29 votes) Log in to vote

Jonathan Mickelson   Jonathan Mickelson - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
If $$testVar = 35:
VariableLocalize ( "$$testVar" )
  Sample output:
$testVar = 35 and
$$testVar = null

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Requires FileMaker 8 or higher.

This function Transfers the contents of a Global Variable to a Local Variable of the same name and clears the original variable.

This is valuable for instances where a Global Variable has been used throughout a process or number of scripts and it no longer needs to exist once the current script completes. Thus the now local variable will be destroyed when the script stops, simplifying cleanup.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: