_getVariable ( )

Function stats

Average user rating
34
159
9999
Support
FileMaker 7.0 +
Date posted
22 December 2008
Last updated
23 December 2008
Version
Recursive function
No

Author Info
 The Shadow

22 functions

Average Rating 4.3

author_avatar



 

Function overview

Prototype

_getVariable  ( varName;   index )


Parameters

varName  The global variable name


index  The index to access


Description

Tags:  Variables  

This function is the corresponding one to _setVariable(), 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

_getVariable( "$$a"; 1 )


Sample output

The contents of variable $$a[1].

 

Function code

If (Left(varName;2) = "$$";
Evaluate( varName & "[" & index & "]" ); "<bug>" )

// ===================================
/*

    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/159

    Prototype: _getVariable( varName; index )
    Function Author: The Shadow (http://www.fmfunctions.com/mid/34)
    Last updated: 23 December 2008
    Version: 1.1

*/
// ===================================

 

Comments

kaostika
07 June 2011



Hi, Is there a way to set the Index with a variable like _getVariable( "$$a"; $3 )
  General comment
The Shadow
09 June 2011



You mean _setVariable()?:

http://www.fmfunctions.com/functions_display_record.php?functionId=160
  General comment