FM.field.set.fullName ( )

Function stats

Average user rating
37
306
9999
Support
FileMaker 8.0 +
Date posted
21 April 2011
Version
1
Recursive function
No

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

FM.field.set.fullName  ( _table;   _field;   _repetition )


Parameters

_table  


_field  


_repetition  


Description

Tags:  Dev   Design  

Allows to set easily a full field name, typically for use with Set Field By Name script step.

_table: a table occurrence name or a full field name. Can be empty if passed in the _field parameter (full field name). If _table is empty and _field does not include the table name, the current layout table occurrence is used.
_field: a field name or a full field name.
_repetition: a number (1 by default)

Error trapped in $$ERROR.CF

Examples

Sample input

FM.field.set.fullName ( "TT::FF" ; "T::F" ; "" )


Sample output

TT::F[1]

 

Function code

/*
FM.field.set.fullName ( _table ; _field ; _repetition )

by Fabrice Nordmann, 1-more-thing
http://www.1-more-thing.com


Apr 2011


Allows to set easily a full field name, typically for use with Set Field By Name script step.

_table: a table occurrence name or a full field name. Can be empty if passed in the _field parameter (full field name). If _table is empty and _field does not include the table name, the current layout table occurrence is used.
_field: a field name or a full field name.
_repetition: a number (1 by default)

Error trapped in $$ERROR.CF

*/


Case ( IsEmpty ( _field ) ; "" ;

Let ([
    _field_m = Case ( PatternCount ( _field ; "::" ) ; GetValue ( Substitute ( _field ; "::" ; ¶ ) ; 2 ) ; _field ) ;
    _table_m =
        Case ( IsEmpty ( _table ) ;
            Case ( PatternCount ( _field ; "::" ) ; GetValue ( Substitute ( _field ; "::" ; ¶ ) ; 1 ) ; Get ( LayoutTableName )) ;
            Case ( PatternCount ( _table ; "::" ) ; GetValue ( Substitute ( _table ; "::" ; ¶ ) ; 1 ) ; _table )
        ) ;
    _repetition_m = Floor ( GetAsNumber ( _repetition )) ;
    _repetition_m = Case ( _repetition_m <= 1 ; 1 ; _repetition_m ) ;
    _result = _table_m & "::" & _field_m & "[" & _repetition_m & "]" ;
    $$ERROR.CF = Case ( EvaluationError ( GetField ( _result )) = 102 ; "ERROR 102. FM.field.set.fullName ( " & Quote ( _table ) & " ; " & Quote ( _field ) & " ; " & Quote ( _repetition ) & " ) has thrown an Evaluation Error 102 (field missing) for result: "& _result & Case ( not IsEmpty ( Get ( ScriptName )) ; "¶Script: " & Get ( ScriptName )) & Case ( not IsEmpty ( Get ( ScriptParameter )) ; "¶Parameter: " & Get ( ScriptParameter )))
];
_result
)
)


/* TEST CASE */
/*
list (
FM.field.set.fullName ( "T" ; "" ; "" ) = "" ;
FM.field.set.fullName ( "T::F" ; "" ; "" ) = "" ;
FM.field.set.fullName ( "" ; "F" ; "" ) = Get ( LayoutTableName ) & "::F[1]" ;
FM.field.set.fullName ( "" ; "T::F" ; "" ) = "T::F[1]" ;
FM.field.set.fullName ( "TT::FF" ; "T::F" ; "" ) = "TT::F[1]" ;
FM.field.set.fullName ( "T" ; "F" ; "-3,5" ) = "T::F[1]" ;
FM.field.set.fullName ( "T" ; "F" ; "3,5" ) = "T::F[3]"
)
*/

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

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

    Prototype: FM.field.set.fullName( _table; _field; _repetition )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 21 April 2011
    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)