TabNamesFrontMost ( )

Function stats

Average user rating
324
367
9999
Support
FileMaker 8.5 +
Date posted
18 June 2014
Version
1
Recursive function
No

Author Info
 DanShockley

1 functions

Average Rating None

author_avatar



 

Function overview

Prototype

TabNamesFrontMost  (  )


Parameters

No parameters for this function.


Description

Tags:  Tab   Layout Objects   Interface   Frontmost  

Gets a return-delimited list of the object names of the frontmost (nested) tabs. Does not include sub-tabs whose parent is not ALSO frontmost. No recursion.

Examples

Sample input

TabNamesFrontMost ( )


Sample output

ContactInfo
Addresses

 

Function code

// TabNamesFrontMost ( )
// version 1.0, Daniel A. Shockley

/* Gets a return-delimited list of the object names of the frontmost (nested) tabs. Does not include sub-tabs whose parent is not ALSO frontmost. No recursion. */

/* VERSION HISTORY

1.0 - original version. Builds a non-recursive calculation that includes only frontmost tabs whose parent is ALSO frontmost. Inspired by Todd Geist's code which included all frontmost tabs (regardless of parent state). See Todd's code at https://www.geistinteractive.com/2011/04/04/get-front-tab-names-with-out-recursion/

To see how this works, you can temporarily remove the Evaluate and just view the 'mainCode' result.

*/

Let ( [

/* setup the prefix and suffix vars for parts of the calc */
calcMainPrefix = "Let ([ ¶frontTabs = \"\"¶¶"
; calcMainSuffix = "¶];¶¶frontTabs¶¶)"
; calcObjPrefix = "; objName = \""
; calcObjSuffix = "\"¶; parentObjName = GetLayoutObjectAttribute ( objName ; \"enclosingObject\" )¶; parentIsFront = IsEmpty ( parentObjName ) or GetLayoutObjectAttribute ( parentObjName ; \"isFrontTabPanel\" )¶; frontTabs = List ( frontTabs; If ( parentIsFront and GetLayoutObjectAttribute ( objName ; \"isFrontTabPanel\" ); objName; \"\" ) )"

/* Get the object names from this layout */
; objectNames = Substitute(
    LayoutObjectNames ( Get( FileName ); Get( LayoutName ) );
    ["<¶";""];
    [">¶";""];
    [">";""]
    )

    
/* build the overall code */
; objectCode = calcObjPrefix & Substitute ( objectNames; "¶"; calcObjSuffix & "¶" & calcObjPrefix ) & calcObjSuffix

; mainCode = calcMainPrefix & objectCode & calcMainSuffix
];

Evaluate (
    mainCode
    )

)

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

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

    Prototype: TabNamesFrontMost( )
    Function Author: DanShockley (http://www.fmfunctions.com/mid/324)
    Last updated: 18 June 2014
    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)