xml2var.clear ( )

Function stats

Average user rating
37
324
9999
Support
FileMaker 8.0 +
Date posted
22 March 2012
Version
1
Recursive function
No

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

xml2var.clear  ( _variable )


Parameters

_variable  the same variable as the one used to evaluate xml2var.


Description

Tags:  xml   Variables   Dev   Debug  

Clears all variables declared by xml2var.

_variable should be the same variable as the one used to evaluate xml2var.

example :

- a script parameter is : "<NAME>Smith</NAME><NAME.FIRST>John</NAME.FIRST>"
- convert it to variable using: Set Variable [ $void ; Get ( ScriptParameter )]
    the result is:
        $NAME = "Smith"
        $NAME.FIRST = "John"
        and
        $void = 2 variables declared...
- clear the declared variables using: xml2var.clear ( $void )

Useful in loops to clear all variables declared in an iteration, or to work with several sets of variables.

Examples

Sample input

xml2var.clear ( $void )


Sample output

clears all variables that were declared by
Let ( $void = xml2var ( $someXML ) ; "" )

 

Function code

/* xml2var.clear ( _variable )


by Fabrice Nordmann, 1-more-thing

http://www.1-more-thing.com
http://www.twitter.com/1morethingtweet

v1. March 2012


Clears all variables declared by xml2var.


_variable should be the same variable as the one used to evaluate xml2var.

example :

- a script parameter is : "<NAME>Smith</NAME><NAME.FIRST>John</NAME.FIRST>"
- convert it to variable using: Set Variable [ $void ; Get ( ScriptParameter )]
    the result is:
        $NAME = "Smith"
        $NAME.FIRST = "John"
        and
        $void = 2 variables declared...
- clear the declared variables using: xml2var.clear ( $void )

Useful in loops to clear all variables declared in an iteration, or to work with several sets of variables.

*/

Let ([ $cf.param = _variable ;
    _count = GetAsNumber ( LeftWords ( $cf.param ; 1 )) ;
    _evalString = Case ( _count ; "Let ([" & Substitute ( RightValues ( $cf.param ; ValueCount ( $cf.param ) - 1 ) ; "=" ; "=\"\";//" ) & "nothing=\"\"] ;\"\")" ) ;
    $cf.param = ""
];
    Case ( _count ;
        Evaluate ( _evalString )
    )
)

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

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

    Prototype: xml2var.clear( _variable )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 22 March 2012
    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)