VariablesResetAll ( )

Function stats

Average user rating
5.0000
37
106
9999
Support
FileMaker 8.0 +
Date posted
05 December 2008
Version
1
Recursive function
Yes

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

VariablesResetAll  (  )


Parameters

No parameters for this function.


Description

Tags:  Variables   Debug  

removes all global variables logged in $$_VariablesLog by VariablesLog ()

Examples

Sample input

VariablesResetAll ()


Sample output

deletes all variables declared with VariablesLog

 

Function code

/*
VariablesResetAll ( )
Fabrice Nordmann's adaptation of

VariableDestroyAll ( )
by
Jonathan Mickelson, Thought Development Corp.
http://thought-dev.com

to work with VariableLog ( key ; value ).

removes all global variables logged in $$_VariablesLog by VariablesLog ()
*/

Let (
[
// Incomming Parameters
valsTot = ValueCount ( $$_VariablesLog ) ;
lastVal = GetValue ( $$_VariablesLog ; valsTot ) ;

// Get Variable Name out of Last Value
var = Substitute ( LeftValues ( Substitute ( lastVal ; "|" ; "¶") ; 1 ) ; "¶" ; "") ;

// Initialize/SetVariable to entered Value
letTxt = "Let ( " & var & " = \"\" ; \"\" )" ;
initialize = Evaluate ( LetTxt ) ;


// Test if Variable already exists - Prepares result for user feedback
$$_VariablesLog = LeftValues ( $$_VariablesLog ; valsTot - 1 ) ;
result = Case ( WordCount ( $$_VariablesLog ) = 0 ; 1 ; 0 ) ;

// Remove Global Variable Storage if finished
$$_VariablesLog = Case ( result = 1 ; "" ; $$_VariablesLog )
] ;

Case ( result = 1; result ; VariablesResetAll )
) // END LET

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

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

    Prototype: VariablesResetAll( )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 05 December 2008
    Version: 1

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

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)