Function overview
Prototype
GlobalList (
KeepTable; ExcludeTable; KeepGlobal; ExcludeGlobal; Attribute; Option; View )
Parameters
KeepTable Filter of Table Occurrences
ExcludeTable Filter of Table Occurrences
KeepGlobal Filter of globals fields
ExcludeGlobal Filter of globals fields
Attribute Source or Content (or S or C ). Empty, no résult.
Option 1 or Empty, 1 for have type and comment
View “List” or “Web” or Empty ( saw file example )
Description
Tags:
CustomList List Global Field File
File Example here :
http://www.tictac.fr/CoinFileMaker/PageGlobalList.html
GlobalList ( KeepTable ; ExcludeTable ; KeepGlobal ; ExcludeGlobal ; Attribute ; Option ; View )v3.1
requires CustomList( start; End; Function )
Not Recursive
------------------------------------
Have a list or content of globalFields for the whole or part of a file.
Keeps global, simple, calculated or not, repeating field or not.
• returns the list of global used: occurrence, types, comments, names and content, for all occurrences selected.
• as filters and options selected results. 3 different formats list.
• If your selected occurrences have the same name as your layout, you only get the overall list are placed on your layout.
• Depending on the size of the file, the calculation may take a long time, it is important of filtering tables and field to maintain and exclude.
1/ Filter parameters of Table Occurrences, KeepTable & ExcludeTable,. Not case sensitive, Empty, one or more as a list..
> KeepTable : Empty or value(s) • Empty : the global list for all occurrences of your file.
• Not Empty : the global list for all occurrences whose name contains one of the values.
> ExcludeTable : Empty or value(s) • Empty : the global list for all occurrences of your file. selected with KeepTable
• Not Empty : excluded from the list overall global for occurrences whose name contains one of the values.
Example : GlobalList( "z_"; “_ctc_¶z_s” ; ... :
Returns a list of all global for occurrences containing "z_" in their name, but not containing "_ctc_" or "z_s"
2/ Filter parameters of globals , KeepGlobal & ExcludeGlobal. Not case sensitive, Empty, one or more as a list..
> KeepTable : Empty or value(s) • Empty : the global list for all occurrences previously selected.
• Not Empty : List only the global whose name contains one of the values for occurrences previously selected.
> ExcludeTable : Empty or value(s) • Empty : the global list selected with KeepGlobal
• Not Empty : excluded from the list overall global whose name contains one of the values for occurrences previously selected.
Example : GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; ... :
Returns a list of all global whose name contains "zkv_" or "zki_" but not containing "zkv_g" for occurrences previously selected.
3/Parameters result, Attribute, Option & View :
> Attribute : Source or Content (or S or C ). Empty, no résult.
• Source : list of occurrences selected with global field name selected :
NameTable1¶NameTable1::GlobalName1¶NameTable1::GlobalName2, if not global, returns "-NoGlobalFound-"
• Content : Add in the list the content for each global selected, if the content is empty, returns "-Empty-"
> Option : 1 or Empty
• “1” : add in the list , type and field comments for each global selected.
> View : “List” or “Web” or Empty
• Empty : List without “mise en page” (with • and ——)
• “List” : List with "mise en page".
• “Web” : List in table format, readable in a Web Viewer or exported, including HTML
Example :
GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; “Source” ; “1” ; “List” )
GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; ""; “Content” ; “1” ; “Web” )
Examples
Sample input
GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; “Source” ; “1” ; “List” )
-----------------
GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; ""; “Content” ; “0” ; “Web” )
Sample output
List of globalFields
name & type & comment
-----------------
List of globalFields
name & type & comment & content. table
[saw file example please]
Function code
// GlobalList ( KeepTable ; ExcludeTable ; KeepGlobal ; ExcludeGlobal ; Attribute ; Option ; View )v3.1
// requires CustomList( start; End; Function )
//------------------------------------
/*
Have a list or content of globalFields for the whole or part of a file.
Keeps global, simple, calculated or not, repeating field or not.
• returns the list of global used: occurrence, types, comments, names and content, for all occurrences selected.
• as filters and options selected results. 3 different formats list.
• If your selected occurrences have the same name as your layout, you only get the overall list are placed on your layout.
• Depending on the size of the file, the calculation may take a long time, it is important of filtering tables and field to maintain and exclude.
1/ Filter parameters of Table Occurrences, KeepTable & ExcludeTable,. Not case sensitive, Empty, one or more as a list..
> KeepTable : Empty or value(s) • Empty : the global list for all occurrences of your file.
• Not Empty : the global list for all occurrences whose name contains one of the values.
> ExcludeTable : Empty or value(s) • Empty : the global list for all occurrences of your file. selected with KeepTable
• Not Empty : excluded from the list overall global for occurrences whose name contains one of the values.
Example : GlobalList( "z_"; “_ctc_¶z_s” ; ... :
Returns a list of all global for occurrences containing "z_" in their name, but not containing "_ctc_" or "z_s"
2/ Filter parameters of globals , KeepGlobal & ExcludeGlobal. Not case sensitive, Empty, one or more as a list..
> KeepTable : Empty or value(s) • Empty : the global list for all occurrences previously selected.
• Not Empty : List only the global whose name contains one of the values for occurrences previously selected.
> ExcludeTable : Empty or value(s) • Empty : the global list selected with KeepGlobal
• Not Empty : excluded from the list overall global whose name contains one of the values for occurrences previously selected.
Example : GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; ... :
Returns a list of all global whose name contains "zkv_" or "zki_" but not containing "zkv_g" for occurrences previously selected.
3/Parameters result, Attribute, Option & View :
> Attribute : Source or Content (or S or C ). Empty, no résult.
• Source : list of occurrences selected with global field name selected :
NameTable1¶NameTable1::GlobalName1¶NameTable1::GlobalName2, if not global, returns "-NoGlobalFound-"
• Content : Add in the list the content for each global selected, if the content is empty, returns "-Empty-"
> Option : 1 or Empty
• “1” : add in the list , type and field comments for each global selected.
> View : “List” or “Web” or Empty
• Empty : List without “mise en page” (with • and ——)
• “List” : List with "mise en page".
• “Web” : List in table format, readable in a Web Viewer or exported, including HTML
Example : GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; “Source” ; “1” ; “List” )
GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; ""; “Content” ; “1” ; “Web” )
*/
//-------------------------------------------------------*/
// Agnès Barouh - Juin 2009 - Substitute( filemaker§tictac.fr; §; @ )
// File example : http://www.tictac.fr/CoinFileMaker/PageGlobalList.html
//-------------------------------------------------------*/
Let([
$gl_KT = Upper( KeepTable );
$gl_ET = Upper( ExcludeTable );
$gl_KG = Upper( KeepGlobal );
$gl_EG = Upper( ExcludeGlobal );
$gl_AT = Left( Attribute; 1 ) ;
$gl_OP = Option;
$gl_VW = View;
$rc = ¶; $gl_o = "["; $gl_f = "]"; $gl_Fie = "::" ; $gl_FieF = "</:|:>" ; $null = "" ; $gl_BR = "<br />" ;
$gl_k = "kkeepp"; $gl_n = "nnonee";
$gl_Tab = "<glaTab>"; $gl_TabF = "</glaTab>" ;
$gl_Typ = "<glaTyp>" ; $gl_Con = "<glaCon>" ;
$gl_Com = "<glaCom>" ; $gl_ComF = "</glaCom>" ;
$gl_Glob = "Global" ; $gl_Stor = "StoredCalcUnindexed" ;
$gl_FI = Get ( FileName ) ;
$gl_FirstList = TableNames( $gl_FI );
/* Table */ $gl_keepT = Case( IsEmpty( $gl_KT & $gl_ET ); $gl_FirstList;
Let([
$gl_List = Substitute( Upper( $gl_FirstList ) ; [ $rc ; $rc & "glarc" ] );
$gl_Count = ValueCount( $gl_ET )+0;
$gl_Val = Case( not IsEmpty( $gl_ET ) ; $gl_ET & ¶ ) & ¶ & $gl_KT ;
Trigger = CustomList( 1; ValueCount( $gl_Val );
"Let([V = GetValue( $gl_Val; [n] ); $gl_List = Substitute( $gl_List; V; Case(([n]+0) ≤ $gl_Count; $gl_n ; $gl_k ))]; $null)" ) ;
$gl_List = Substitute( $gl_List ; "glarc" ; "" )
]; Case( IsEmpty( $gl_KT );
FilterValues($gl_FirstList; $gl_List);
CustomList( 1; ValueCount( $gl_List );
"Let([V = GetValue( $gl_List; [n] )]; Case( PatternCount( V; $gl_k ) And not PatternCount( V; $gl_n ); GetValue( $gl_FirstList; [n] )))"))));
$gl_CountE = ValueCount( $gl_EG );
$gl_CountK = ValueCount( $gl_KG );
/* Field */ $gl_keepF = CustomList( 1; ValueCount( $gl_keepT );
"Let([
$OT = GetValue( $gl_keepT; [n] );
$gl_FL = FieldNames( $gl_FI ; $OT );
$gl_FLM = Substitute( Upper( $gl_FL ) ; [ $gl_Fie ; $gl_n ] );
trigger = CustomList( 1; $gl_CountE ; \"Let([ V = GetValue( $gl_EG; [n] ); $gl_FLM = Substitute( $gl_FLM ; V ; $gl_n )];$null)\") ;
$gl_FL = FilterValues( $gl_FL ; $gl_FLM );
$gl_FLM = Substitute( Upper ( $gl_FL ) ; [ $rc ; $rc & \"glarc\"] ) ;
trigger = CustomList( 1; $gl_CountK ; \"Let([ V = GetValue( $gl_KG; [n]); $gl_FLM = Substitute( $gl_FLM ; V ; $gl_k )];$null)\") ;
$gl_FLM = Substitute ( $gl_FLM ; [$gl_k ; \"\"] ; [ \"glarc\" ; \"\"] );
$gl_tou = Case ( $gl_CountK < 1 ; $gl_FL; CustomList( 1; ValueCount( $gl_FLM ); \"Let([ V = GetValue( $gl_FL; [n] )]; Case( V <> GetValue( $gl_FLM; [n] ); V ))\")) ;
Re = CustomList( 1; ValueCount( $gl_Tou );
\"Let([ V = $OT & $gl_Fie & GetValue( $gl_Tou; [n] ); TypeAll = FieldType( $gl_FI ; V ); G = LeftWords( TypeAll; 1 ); Ite = RightWords( TypeAll; 1 ) + 0 ;
$gl_Res = Case( G = $gl_Glob ; V; Case( G & MiddleWords( TypeAll; 3; 1 ) = $gl_Stor ; EvaluationError( Evaluate( V ))) = 0; V )
]; Case( not IsEmpty( $gl_Res ); Case( $gl_OP = 1; $gl_Typ & TypeAll & $gl_Com & Substitute( FieldComment( $gl_FI ; V ) ; $rc ; $gl_BR ) & $gl_ComF & $rc )
& Case( Ite = 1 ; $gl_Res ; CustomList( 1; Ite; \"\"$gl_Res & $gl_o & [n] & $gl_f \"\") )))\")
]; $gl_Tab & TextStyleAdd( $OT ; Bold ) & $gl_TabF & $rc & Re )");
$gl_Result = Case( $gl_AT = "S"; $gl_keepF;
$gl_AT = "C"; CustomList( 1; ValueCount( $gl_keepF );
"Let([
V = GetValue( $gl_keepF; [n] );
Test = PatternCount( V; $gl_Fie ) and not PatternCount( V; $gl_Typ ); T = Case( Test > 0; Evaluate( V ))
]; Case( Test < 1; V ; V & $gl_Con & Case( IsEmpty( T ); \"-Empty-\"; Substitute( T ; [$rc ; $gl_BR ] ; [ $gl_Fie ; $gl_FieF ]))))")) ;
$gl_keepF = "" ; $gl_FirstList = "" ; $gl_List = "" ; $gl_keepT = "" ; $gl_FL = "" ; $gl_FLM = "" ; $gl_OT = "" ; $gl_Res = "" ;
R = Case( IsEmpty( View ) ;
Substitute( $gl_Result ; [$gl_Tab ; "" ] ; [$gl_TabF ; ""] ; [$gl_Typ ; ""] ; [$gl_Com ; "¶"] ; [$gl_ComF ; ""] ; [$gl_Con ; "¶"] ; [$gl_BR ; ¶ ] ) ;
View = "List";
Substitute( $gl_Result ; [$gl_Tab ; "——————————————————¶" & TextStyleAdd ( TextColor ( "•" ; RGB ( 255 ; 100 ; 0 ) ) & " Table" ; Bold ) & " : " ] ; [$gl_TabF ; ""] ;
[$gl_Typ ; "——————————————————¶• Type : "] ; [$gl_Com ; "¶• Comment : "] ; [$gl_ComF ; ""] ; [$gl_Con ; "¶• Content : "] ; [$gl_BR ; ¶ ] ; [$gl_FieF ; "::"] ) ;
View = "Web";
Let([
WebEnTete = "<html><style type=\"text/css\">
body { background-color: #E9E8E6;}
table { margin: auto; background-color: #EEEEEE; border: 4px outset #636375; border-collapse: collapse; }
th { background-color: #636375; color: #EEEEEE; font-size: 11px; }
td, th { height: 25px; vertical-align: Midde; border: 1px solid black; font-family: Verdana, Arial, Helvetica, Times, serif; text-align: Left; padding: 5px; font-size: 10px; }
</style> <body><table border=1>
<tr><th colspan = 7>Globals from file : " & $gl_FI & "</th></tr>
<tr><th width = 20px>n°</th><th>Occurrences</th>" &
Case( $gl_OP = 1 ; "<th>GlobalType</th><th>GlobalComment</th>" ) &
"<th width = 20px>n°</th><th>GlobalName</th>" &
Case( $gl_AT = "C" ; "<th>GlobalContent</th>" ) & "</tr>" ;
WebEnFin = "</table></body></html>" ;
$gl_Row = "<td rowspan=" ; $gl_RowE = ">" ;
$gl_TdL = "<td>" ; $gl_TdR = "</td>" ;
$gl_TrL = "<tr>" ; $gl_TrR = "</tr>" ;
$gl_Num = "<gla_Num>" ;
$gl_Web = Substitute( $gl_Result & $gl_Tab ; [$gl_TabF & $rc ; Case( $gl_OP = 1 ; "</td>" ; "</td><td>1</td><td>" )] ; [$gl_TabF ; Case( $gl_OP = 1 ; "</td>" ; "</td><td>1</td><td>" )] ;
[ $gl_Com ; "</td>" & $gl_Com ] ;[$gl_ComF & $rc ; "</td><td><gla_Num></td><td>"] ) ;
Web = Case( $gl_OP = 1 ;
CustomList( 1 ; PatternCount( $gl_Web ; $gl_Tab ) - 1 ;
"Let([ PosL = Position( $gl_Web ; $gl_Tab ; 1 ; [n] ) ;
$gl_Ex = Middle( $gl_Web ; PosL ;(Position( $gl_Web ; $gl_Tab ; 1 ; [n] + 1 )) - PosL ) ;
NField = PatternCount( $gl_Ex ; $gl_Fie ) ;
NType = PatternCount( $gl_Ex ; $gl_Typ ) ;
$gl_ExT = Substitute( $gl_Ex ; [$gl_Tab ; $gl_Row & NField & $gl_RowE ] ; [$gl_Typ ; $rc & $gl_Typ ]) ;
$gl_Xml = CustomList( 1 ; NType ; \"Let([
V = $gl_ExT & $rc & $gl_Typ ;PosL = Position( V ; $gl_Typ ; 1 ; [n] ) ; ExTy = Middle( V ; PosL ; Position( V ; $gl_Typ ; 1 ; [n] + 1 ) - PosL - 1 ) ; NFieldB = PatternCount( ExTy ; $gl_Fie )
]; Case( [n] > 1 ; $gl_TrL ) & Substitute( ExTy ; [$gl_Typ ; $gl_Row & NFieldB & $gl_RowE] ; [$gl_Com ; $gl_Row & NFieldB & $gl_RowE & $gl_Com ] ))\") ;
TF = CustomList( 1 ; ValueCount( $gl_Xml ) ;
\"Let([ V = GetValue( $gl_Xml ; [n] ) ]; Case( PatternCount( V ; $gl_Fie) And Not PatternCount( V ; $gl_TdL ) ; $gl_TrL & $gl_TdL & [n] & $gl_TdR & $gl_TdL & V & $gl_TdR & $gl_TrR ; Substitute( V ; $gl_Num ; [n] ) & $gl_TdR ))\" )
]; $gl_TrL & $gl_Row & NField & $gl_RowE & [n] & $gl_TdR & GetValue( $gl_ExT ; 1 ) & TF & Case( Nfield < 1 ; $gl_TdL & $gl_TdR ) & $gl_TrR )" )
;
CustomList( 1 ; PatternCount( $gl_Web ; $gl_Tab ) - 1 ;
"Let([ PosL = Position( $gl_Web ; $gl_Tab ; 1 ; [n] ) ;
$gl_Ex = Middle( $gl_Web ; PosL ; Position( $gl_Web ; $gl_Tab ; 1 ; [n] + 1 ) - PosL ) ;
NField = PatternCount( $gl_Ex ; $gl_Fie ) ;
$gl_ExT = Substitute( $gl_Ex ; [$gl_Tab ; $gl_Row & NField & $gl_RowE] ) ;
T = Case( NField < 2 ; $gl_ExT & $gl_TdR ; GetValue( $gl_ExT ; 1 ) & $gl_TdR & $rc & CustomList( 2 ; NField ; \"$gl_TrL & $gl_TdL & [n] & $gl_TdR & $gl_TdL & GetValue( $gl_ExT ; [n] ) & $gl_TdR & $gl_TrR\" ))
]; $gl_TrL & $gl_Row & NField & $gl_RowE & [n] & $gl_TdR & T )" )
)
];
WebEnTete & Substitute( Web ; [$gl_Com & "</td>" ; "-NoComment-</td>"] ; [$gl_Com ; ""] ; [$gl_Con ; "</td><td>"] ; [$gl_FieF ; "::"] ;
["<td></td>" ; "<td colspan=\"" & Case ( $gl_OP = 1 and $gl_AT = "C" ; 5 ; $gl_OP = 1 and $gl_AT = "S" ; 4 ; $gl_AT = "C" ; 2 ) & "\">" & "-NoGlobalFound-</td>"] ) & WebEnFin
)) ;
$gl_Result = "" ; $gl_Web = ""
];
R
)
// ===================================
/*
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/232
Prototype: GlobalList( KeepTable; ExcludeTable; KeepGlobal; ExcludeGlobal; Attribute; Option; View )
Function Author: Agnès (http://www.fmfunctions.com/mid/46)
Last updated: 21 July 2009
Version: 1.4
*/
// ===================================
// GlobalList ( KeepTable ; ExcludeTable ; KeepGlobal ; ExcludeGlobal ; Attribute ; Option ; View )v3.1__LITBR__// requires CustomList( start; End; Function )__LITBR__//------------------------------------__LITBR__/*__LITBR__ Have a list or content of globalFields for the whole or part of a file.__LITBR__ Keeps global, simple, calculated or not, repeating field or not.__LITBR____LITBR__ • returns the list of global used: occurrence, types, comments, names and content, for all occurrences selected.__LITBR__ • as filters and options selected results. 3 different formats list.__LITBR____LITBR__ • If your selected occurrences have the same name as your layout, you only get the overall list are placed on your layout.__LITBR__ • Depending on the size of the file, the calculation may take a long time, it is important of filtering tables and field to maintain and exclude.__LITBR____LITBR__1/ Filter parameters of Table Occurrences, KeepTable & ExcludeTable,. Not case sensitive, Empty, one or more as a list..__LITBR____LITBR__> KeepTable : Empty or value(s) • Empty : the global list for all occurrences of your file.__LITBR__ • Not Empty : the global list for all occurrences whose name contains one of the values.__LITBR____LITBR__> ExcludeTable : Empty or value(s) • Empty : the global list for all occurrences of your file. selected with KeepTable__LITBR__ • Not Empty : excluded from the list overall global for occurrences whose name contains one of the values.__LITBR____LITBR__ Example : GlobalList( "z_"; “_ctc_¶z_s” ; ... :__LITBR__ Returns a list of all global for occurrences containing "z_" in their name, but not containing "_ctc_" or "z_s"__LITBR____LITBR__2/ Filter parameters of globals , KeepGlobal & ExcludeGlobal. Not case sensitive, Empty, one or more as a list..__LITBR____LITBR__> KeepTable : Empty or value(s) • Empty : the global list for all occurrences previously selected.__LITBR__ • Not Empty : List only the global whose name contains one of the values for occurrences previously selected.__LITBR____LITBR__> ExcludeTable : Empty or value(s) • Empty : the global list selected with KeepGlobal__LITBR__ • Not Empty : excluded from the list overall global whose name contains one of the values for occurrences previously selected.__LITBR____LITBR__ Example : GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; ... :__LITBR__ Returns a list of all global whose name contains "zkv_" or "zki_" but not containing "zkv_g" for occurrences previously selected.__LITBR____LITBR__3/Parameters result, Attribute, Option & View :__LITBR____LITBR__> Attribute : Source or Content (or S or C ). Empty, no résult.__LITBR__ • Source : list of occurrences selected with global field name selected :__LITBR__ NameTable1¶NameTable1::GlobalName1¶NameTable1::GlobalName2, if not global, returns "-NoGlobalFound-"__LITBR__ • Content : Add in the list the content for each global selected, if the content is empty, returns "-Empty-"__LITBR____LITBR__> Option : 1 or Empty__LITBR__ • “1” : add in the list , type and field comments for each global selected.__LITBR____LITBR__> View : “List” or “Web” or Empty__LITBR__ • Empty : List without “mise en page” (with • and ——)__LITBR__ • “List” : List with "mise en page".__LITBR__ • “Web” : List in table format, readable in a Web Viewer or exported, including HTML__LITBR____LITBR__ Example : GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; "zkv_g"; “Source” ; “1” ; “List” )__LITBR__ GlobalList( "z_"; “_ctc_¶z_s” ; "zkv_¶zki_"; ""; “Content” ; “1” ; “Web” )__LITBR__*/__LITBR__//-------------------------------------------------------*/__LITBR__// Agnès Barouh - Juin 2009 - Substitute( filemaker§tictac.fr; §; @ )__LITBR__// File example : http://www.tictac.fr/CoinFileMaker/PageGlobalList.html__LITBR__//-------------------------------------------------------*/__LITBR____LITBR____LITBR__Let([__LITBR__ $gl_KT = Upper( KeepTable );__LITBR__ $gl_ET = Upper( ExcludeTable );__LITBR__ $gl_KG = Upper( KeepGlobal );__LITBR__ $gl_EG = Upper( ExcludeGlobal );__LITBR__ $gl_AT = Left( Attribute; 1 ) ;__LITBR__ $gl_OP = Option;__LITBR__ $gl_VW = View;__LITBR____LITBR__ $rc = ¶; $gl_o = "["; $gl_f = "]"; $gl_Fie = "::" ; $gl_FieF = "</:|:>" ; $null = "" ; $gl_BR = "<br />" ;__LITBR__ $gl_k = "kkeepp"; $gl_n = "nnonee";__LITBR__ $gl_Tab = "<glaTab>"; $gl_TabF = "</glaTab>" ;__LITBR__ $gl_Typ = "<glaTyp>" ; $gl_Con = "<glaCon>" ;__LITBR__ $gl_Com = "<glaCom>" ; $gl_ComF = "</glaCom>" ;__LITBR__ $gl_Glob = "Global" ; $gl_Stor = "StoredCalcUnindexed" ;__LITBR__ $gl_FI = Get ( FileName ) ;__LITBR____LITBR__ $gl_FirstList = TableNames( $gl_FI );__LITBR____LITBR__/* Table */ $gl_keepT = Case( IsEmpty( $gl_KT & $gl_ET ); $gl_FirstList;__LITBR__ Let([__LITBR__ $gl_List = Substitute( Upper( $gl_FirstList ) ; [ $rc ; $rc & "glarc" ] );__LITBR__ $gl_Count = ValueCount( $gl_ET )+0;__LITBR__ $gl_Val = Case( not IsEmpty( $gl_ET ) ; $gl_ET & ¶ ) & ¶ & $gl_KT ;__LITBR__ Trigger = CustomList( 1; ValueCount( $gl_Val );__LITBR__"Let([V = GetValue( $gl_Val; [n] ); $gl_List = Substitute( $gl_List; V; Case(([n]+0) ≤ $gl_Count; $gl_n ; $gl_k ))]; $null)" ) ;__LITBR__ $gl_List = Substitute( $gl_List ; "glarc" ; "" )__LITBR__ ]; Case( IsEmpty( $gl_KT );__LITBR__ FilterValues($gl_FirstList; $gl_List);__LITBR__ CustomList( 1; ValueCount( $gl_List );__LITBR__"Let([V = GetValue( $gl_List; [n] )]; Case( PatternCount( V; $gl_k ) And not PatternCount( V; $gl_n ); GetValue( $gl_FirstList; [n] )))"))));__LITBR____LITBR__ $gl_CountE = ValueCount( $gl_EG );__LITBR__ $gl_CountK = ValueCount( $gl_KG );__LITBR____LITBR__/* Field */ $gl_keepF = CustomList( 1; ValueCount( $gl_keepT );__LITBR__"Let([__LITBR__$OT = GetValue( $gl_keepT; [n] );__LITBR__$gl_FL = FieldNames( $gl_FI ; $OT );__LITBR__$gl_FLM = Substitute( Upper( $gl_FL ) ; [ $gl_Fie ; $gl_n ] );__LITBR__trigger = CustomList( 1; $gl_CountE ; \"Let([ V = GetValue( $gl_EG; [n] ); $gl_FLM = Substitute( $gl_FLM ; V ; $gl_n )];$null)\") ;__LITBR__$gl_FL = FilterValues( $gl_FL ; $gl_FLM );__LITBR__$gl_FLM = Substitute( Upper ( $gl_FL ) ; [ $rc ; $rc & \"glarc\"] ) ;__LITBR__trigger = CustomList( 1; $gl_CountK ; \"Let([ V = GetValue( $gl_KG; [n]); $gl_FLM = Substitute( $gl_FLM ; V ; $gl_k )];$null)\") ;__LITBR__$gl_FLM = Substitute ( $gl_FLM ; [$gl_k ; \"\"] ; [ \"glarc\" ; \"\"] );__LITBR__$gl_tou = Case ( $gl_CountK < 1 ; $gl_FL; CustomList( 1; ValueCount( $gl_FLM ); \"Let([ V = GetValue( $gl_FL; [n] )]; Case( V <> GetValue( $gl_FLM; [n] ); V ))\")) ;__LITBR__Re = CustomList( 1; ValueCount( $gl_Tou ); __LITBR__\"Let([ V = $OT & $gl_Fie & GetValue( $gl_Tou; [n] ); TypeAll = FieldType( $gl_FI ; V ); G = LeftWords( TypeAll; 1 ); Ite = RightWords( TypeAll; 1 ) + 0 ;__LITBR__$gl_Res = Case( G = $gl_Glob ; V; Case( G & MiddleWords( TypeAll; 3; 1 ) = $gl_Stor ; EvaluationError( Evaluate( V ))) = 0; V )__LITBR__]; Case( not IsEmpty( $gl_Res ); Case( $gl_OP = 1; $gl_Typ & TypeAll & $gl_Com & Substitute( FieldComment( $gl_FI ; V ) ; $rc ; $gl_BR ) & $gl_ComF & $rc )__LITBR__& Case( Ite = 1 ; $gl_Res ; CustomList( 1; Ite; \"\"$gl_Res & $gl_o & [n] & $gl_f \"\") )))\")__LITBR__]; $gl_Tab & TextStyleAdd( $OT ; Bold ) & $gl_TabF & $rc & Re )");__LITBR____LITBR__ $gl_Result = Case( $gl_AT = "S"; $gl_keepF;__LITBR__ $gl_AT = "C"; CustomList( 1; ValueCount( $gl_keepF );__LITBR__"Let([__LITBR__V = GetValue( $gl_keepF; [n] );__LITBR__Test = PatternCount( V; $gl_Fie ) and not PatternCount( V; $gl_Typ ); T = Case( Test > 0; Evaluate( V ))__LITBR__]; Case( Test < 1; V ; V & $gl_Con & Case( IsEmpty( T ); \"-Empty-\"; Substitute( T ; [$rc ; $gl_BR ] ; [ $gl_Fie ; $gl_FieF ]))))")) ;__LITBR____LITBR__ $gl_keepF = "" ; $gl_FirstList = "" ; $gl_List = "" ; $gl_keepT = "" ; $gl_FL = "" ; $gl_FLM = "" ; $gl_OT = "" ; $gl_Res = "" ;__LITBR____LITBR__ R = Case( IsEmpty( View ) ;__LITBR__ Substitute( $gl_Result ; [$gl_Tab ; "" ] ; [$gl_TabF ; ""] ; [$gl_Typ ; ""] ; [$gl_Com ; "¶"] ; [$gl_ComF ; ""] ; [$gl_Con ; "¶"] ; [$gl_BR ; ¶ ] ) ;__LITBR____LITBR__ View = "List";__LITBR__ Substitute( $gl_Result ; [$gl_Tab ; "——————————————————¶" & TextStyleAdd ( TextColor ( "•" ; RGB ( 255 ; 100 ; 0 ) ) & " Table" ; Bold ) & " : " ] ; [$gl_TabF ; ""] ;__LITBR__ [$gl_Typ ; "——————————————————¶• Type : "] ; [$gl_Com ; "¶• Comment : "] ; [$gl_ComF ; ""] ; [$gl_Con ; "¶• Content : "] ; [$gl_BR ; ¶ ] ; [$gl_FieF ; "::"] ) ;__LITBR__ View = "Web";__LITBR__ Let([__LITBR__ WebEnTete = "<html><style type=\"text/css\">__LITBR__body { background-color: #E9E8E6;}__LITBR__table { margin: auto; background-color: #EEEEEE; border: 4px outset #636375; border-collapse: collapse; }__LITBR__th { background-color: #636375; color: #EEEEEE; font-size: 11px; }__LITBR__td, th { height: 25px; vertical-align: Midde; border: 1px solid black; font-family: Verdana, Arial, Helvetica, Times, serif; text-align: Left; padding: 5px; font-size: 10px; }__LITBR__</style> <body><table border=1>__LITBR__<tr><th colspan = 7>Globals from file : " & $gl_FI & "</th></tr>__LITBR__<tr><th width = 20px>n°</th><th>Occurrences</th>" &__LITBR__Case( $gl_OP = 1 ; "<th>GlobalType</th><th>GlobalComment</th>" ) &__LITBR__"<th width = 20px>n°</th><th>GlobalName</th>" &__LITBR__Case( $gl_AT = "C" ; "<th>GlobalContent</th>" ) & "</tr>" ;__LITBR__ WebEnFin = "</table></body></html>" ;__LITBR____LITBR__ $gl_Row = "<td rowspan=" ; $gl_RowE = ">" ;__LITBR__ $gl_TdL = "<td>" ; $gl_TdR = "</td>" ;__LITBR__ $gl_TrL = "<tr>" ; $gl_TrR = "</tr>" ;__LITBR__ $gl_Num = "<gla_Num>" ;__LITBR____LITBR__ $gl_Web = Substitute( $gl_Result & $gl_Tab ; [$gl_TabF & $rc ; Case( $gl_OP = 1 ; "</td>" ; "</td><td>1</td><td>" )] ; [$gl_TabF ; Case( $gl_OP = 1 ; "</td>" ; "</td><td>1</td><td>" )] ;__LITBR__ [ $gl_Com ; "</td>" & $gl_Com ] ;[$gl_ComF & $rc ; "</td><td><gla_Num></td><td>"] ) ;__LITBR____LITBR__ Web = Case( $gl_OP = 1 ;__LITBR__CustomList( 1 ; PatternCount( $gl_Web ; $gl_Tab ) - 1 ;__LITBR__"Let([ PosL = Position( $gl_Web ; $gl_Tab ; 1 ; [n] ) ;__LITBR__$gl_Ex = Middle( $gl_Web ; PosL ;(Position( $gl_Web ; $gl_Tab ; 1 ; [n] + 1 )) - PosL ) ;__LITBR__NField = PatternCount( $gl_Ex ; $gl_Fie ) ;__LITBR__NType = PatternCount( $gl_Ex ; $gl_Typ ) ;__LITBR__$gl_ExT = Substitute( $gl_Ex ; [$gl_Tab ; $gl_Row & NField & $gl_RowE ] ; [$gl_Typ ; $rc & $gl_Typ ]) ;__LITBR__$gl_Xml = CustomList( 1 ; NType ; \"Let([__LITBR__V = $gl_ExT & $rc & $gl_Typ ;PosL = Position( V ; $gl_Typ ; 1 ; [n] ) ; ExTy = Middle( V ; PosL ; Position( V ; $gl_Typ ; 1 ; [n] + 1 ) - PosL - 1 ) ; NFieldB = PatternCount( ExTy ; $gl_Fie )__LITBR__]; Case( [n] > 1 ; $gl_TrL ) & Substitute( ExTy ; [$gl_Typ ; $gl_Row & NFieldB & $gl_RowE] ; [$gl_Com ; $gl_Row & NFieldB & $gl_RowE & $gl_Com ] ))\") ;__LITBR__TF = CustomList( 1 ; ValueCount( $gl_Xml ) ;__LITBR__\"Let([ V = GetValue( $gl_Xml ; [n] ) ]; Case( PatternCount( V ; $gl_Fie) And Not PatternCount( V ; $gl_TdL ) ; $gl_TrL & $gl_TdL & [n] & $gl_TdR & $gl_TdL & V & $gl_TdR & $gl_TrR ; Substitute( V ; $gl_Num ; [n] ) & $gl_TdR ))\" )__LITBR__]; $gl_TrL & $gl_Row & NField & $gl_RowE & [n] & $gl_TdR & GetValue( $gl_ExT ; 1 ) & TF & Case( Nfield < 1 ; $gl_TdL & $gl_TdR ) & $gl_TrR )" )__LITBR__ ;__LITBR__CustomList( 1 ; PatternCount( $gl_Web ; $gl_Tab ) - 1 ;__LITBR__"Let([ PosL = Position( $gl_Web ; $gl_Tab ; 1 ; [n] ) ;__LITBR__$gl_Ex = Middle( $gl_Web ; PosL ; Position( $gl_Web ; $gl_Tab ; 1 ; [n] + 1 ) - PosL ) ;__LITBR__NField = PatternCount( $gl_Ex ; $gl_Fie ) ;__LITBR__$gl_ExT = Substitute( $gl_Ex ; [$gl_Tab ; $gl_Row & NField & $gl_RowE] ) ;__LITBR__T = Case( NField < 2 ; $gl_ExT & $gl_TdR ; GetValue( $gl_ExT ; 1 ) & $gl_TdR & $rc & CustomList( 2 ; NField ; \"$gl_TrL & $gl_TdL & [n] & $gl_TdR & $gl_TdL & GetValue( $gl_ExT ; [n] ) & $gl_TdR & $gl_TrR\" ))__LITBR__]; $gl_TrL & $gl_Row & NField & $gl_RowE & [n] & $gl_TdR & T )" )__LITBR__ )__LITBR__ ];__LITBR__WebEnTete & Substitute( Web ; [$gl_Com & "</td>" ; "-NoComment-</td>"] ; [$gl_Com ; ""] ; [$gl_Con ; "</td><td>"] ; [$gl_FieF ; "::"] ;__LITBR__ ["<td></td>" ; "<td colspan=\"" & Case ( $gl_OP = 1 and $gl_AT = "C" ; 5 ; $gl_OP = 1 and $gl_AT = "S" ; 4 ; $gl_AT = "C" ; 2 ) & "\">" & "-NoGlobalFound-</td>"] ) & WebEnFin__LITBR__ )) ;__LITBR__ $gl_Result = "" ; $gl_Web = ""__LITBR__];__LITBR__R__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/232__LITBR____LITBR__ Prototype: GlobalList( KeepTable; ExcludeTable; KeepGlobal; ExcludeGlobal; Attribute; Option; View )__LITBR__ Function Author: Agnès (http://www.fmfunctions.com/mid/46)__LITBR__ Last updated: 21 July 2009__LITBR__ Version: 1.4__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
20 July 2009
(Edited by Agnès on 24/07/09 )