Function overview
Prototype
_setVariable (
varName; index; value )
Parameters
varName The global variable name
index The index to set
value The value to set
Description
Tags:
Variables
This function is the corresponding one to _getVariable(), which allows the usage of dynamic global variables - one's you don't know the name of when you wrote the code.
These variables can be leveraged to create "objects" that are stored within various global variables, for example, see:
http://fmforums.com/forum/showtopic.php?tid/187684
Examples
Sample input
_setVariable( "$$a"; 1; "Foop" )
Sample output
$$a[1] is set to "Foop"
Function code
// This extra let ensures we don't lose the type of value as we would by using Quote()
Let( $_varSetArg = value;
Evaluate( "Let( " & varName & "[" & index & "]=$_varSetArg; $_varSetArg )" )
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/160
Prototype: _setVariable( varName; index; value )
Function Author: The Shadow (http://www.fmfunctions.com/mid/34)
Last updated: 23 December 2008
Version: 1.1
*/
// ===================================
// This extra let ensures we don't lose the type of value as we would by using Quote()__LITBR__Let( $_varSetArg = value;__LITBR__ Evaluate( "Let( " & varName & "[" & index & "]=$_varSetArg; $_varSetArg )" )__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/160__LITBR____LITBR__ Prototype: _setVariable( varName; index; value )__LITBR__ Function Author: The Shadow (http://www.fmfunctions.com/mid/34)__LITBR__ Last updated: 23 December 2008__LITBR__ Version: 1.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
21 December 2008
22 December 2008
I modified VariablesLog accordingly, and I posted a new function on which I would really like to have your feed-back. http://www.fmfunctions.com/fname/datatype
It's now in beta version, but if it was juged as correct, you could implement it in _getVariable, and I would in VariablesLoadFromLog and xml2var
22 December 2008
23 December 2008
Matrix Objects (and a Queue):
http://fmforums.com/forum/showtopic.php?tid/187684
Date Formatter:
http://fmforums.com/forum/showtopic.php?tid/187938/
23 December 2008