Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

CustomList ( Start ; End ; Function )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.3  (144 votes)
  Discuss this Custom Function

Agnes Barouh, Tic Tac
http://www.tictac.fr/CoinFileMaker/Page.html

Update for FileMakerServer. Update for FileMakerGo. Update, new version - customized lists - not recursive - Unlimited

Sample Input:
CustomList ( 3 ; 4 ; "GetValue ( MyList ; [n] )" )

---------------

CustomList ( 25000; 85000; "[n] & "". "" & Get(CurrentDate ) + [n]")

---------------

CustomList ( 2; 5 ; "GetNthRecord ( FieldRecord ; [n])")
Sample Output:
returns "Not¶Recursive" if MyList is
"CustomList¶Is¶Not¶Recursive¶But¶Now¶Unlimited"

---------------

25000. 12/12/2076
25001. 13/12/2076
25002. 14/12/2076
25003. 15/12/2076[...]

---------------

FieldRecord2
FieldRecord3
FieldRecord4
FieldRecord5


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

// Note : 10/16/2015
Carrefull : If you rename CustomList, you must also rename it in code / line "iter"

iter = Let ( $CLExeCount = $CLExeCount + 1 ; $CLExeCount & PatternCount ( Function ; "CustomList" ) + 1 ) ;
becomes
iter = Let ( $CLExeCount = $CLExeCount + 1 ; $CLExeCount & PatternCount ( Function ; "list.custom" ) + 1 ) ;
for example if your rename in list.function

is just a security far unic iter when you used many CustomList in CustomList
( is not really an real incidence but is better, it is a protection )

-----------------------------------------***
Edit November-6 2012 :
v4.8 > Adapte the calc for FileMaker IWP
Carreful : Limited
with FilemakerServer = End - Start ≤ 250000

-----------------------------------------***
Edit November-10 2011 :
v4.7 > Adapte the calc for FileMakerServeur
Carreful : Limited
with FilemakerServer = End - Start ≤ 120000

-----------------------------------------***
Edit August-24 2010 :
v4.6 > Adapte the calc for FileMakerGo
Carreful : Limited
with Filemaker = End - Start ≤ 500000
with FilemakerGo = End - Start ≤ 150000
-----------------------------------------
Edit July-24 2008 :
v4.5 > Replace "Num" by "CLNum"
[please, do not used "CLNum" or $CLn in your calculation with Let() ]
-----------------------------------------
v.4.4 - 5 July 2008 | Change Iter - Change if Result is Empty - And Ugo sign the Notice
v.4.3 - 3 July 2008 | Change FunctionR -> handles litteral carriage returns
-----------------------------------------
is an "Update", new version of CustomList () first version : [http://www.briandunning.com/cf/747]
-----------------------------------------

End or Start are no longer limited,
only the interval between End - Start is limited : ( End - Start ) ≤ 500,000
you can now target from the 50,000th to 100,000th records or more
-------------------------
New calculation, Faster version.
-------------------------
Bonus : For Developper ease, CustomList includes a debugging mode : find the "/*****DEBUGGING MODE*****/" tag in the calculation
if Debug = 1, return Error (formula or result is not correct), else, return "?"
-----------------------------------------

it is not a recursive function
For data processing, customized lists.

-----------------------------------------

For all native functions with a number
Left(), Middle(), GetValue(), GetNthRecord(), GetLayoutObjectAttribute () ...
or any range of numbers, dates, times and timestamps ...

CustomList can be a base for many other customs functions

----------------------------------------- *
CustomList ( 1 ; 1000 ; "Thanks Ugo and Fabrice !" )
----------------------------------------- *

----------------------------------------- more examples
The Argument "Function" can be :
Examples : with [n] to define the numeric list

- "GetNthRecord ( Field ; [n] )"
- """Name =>"" & GetNthRecord ( FieldName ; [n] ) & "" FirstName =>"" & GetNthRecord ( FirstFieldName ; [n] )""
- "[n] & ""."" & MiddleValues ( Field ; [n] ; 1 )"
- "GetAsDate ( Date ) + [n]"
- "GetLayoutObjectAttribute ( ""ObjectName"" ; ""Content"" ; 1 ; [n] )"
- "Let ( [ Value = GetValue ( MyList ; [n] ) ] ; Case ( PatternCount ( Value ; "X" ) ; Value ))"
- "Let ([ $$Var[[n]] = GetNthRecord ( Field ; [n] ) ] ; """" )" // To charge N variable
- "GetRepetition ( RepetitingField ; [n] )" [...]


All native functions including Let (), any Custom Function, including CustomList() itself can be used in a formula into the "Function" argument


------------------------- Under the hood :
Basically, CustomList() does two things :
1/ Transform your formula in litteral chain :

CustomList ( 1; 4; "GetNthRecord ( Field ; [n])")
becomes
"Let ([ CLNum = 1 ] ; GetNthRecord ( Field ; CLNum )) & ¶ &
Let ([ CLNum = 2 ] ; GetNthRecord ( Field ; CLNum )) & ¶ &
Let ([ CLNum = 3 ] ; GetNthRecord ( Field ; CLNum )) & ¶ &
Let ([ CLNum = 4 ] ; GetNthRecord ( Field ; CLNum ))"

2/ Evaluates this chain.

Agnès Barouh
Thanks to ® Ugo Di Luca

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 9 comments

The function uses the iterator n: = n + 1 to calculate the term from one line to the next. I have some applications where I would like to specify a different iterator function. For example, n: = 2 * n + 1 or n: = n ^ 2 or more generally: n: = f (n).

My question: Is it a difficult problem to provide a version of Custom List, which you can specify its own iterator function?

Erich, Rostock/Germany
September 04, 2015 2:40am

Hi,

You can made your own iteration, for example, you can calculate the [n] :

CustomList ( 1 ; 6 ; "[n] * 2 - 2" ) give 0 2 4 6 8 10

CustomList ( 1 ; 6 ;
"Let ([
nb = [n] * 2 ;
P = nb ^ 2
]; P )" )

or CustomList ( 1 ; 10 ; "Get ( CurrentDate ) + ( [n] * 7 )" ) for liste 10 fryday ( today )
I hope this answers your question

Agnès

Agnes, Paris
September 04, 2015 3:08am

That's exactly what I need.
Thank you

Erich, Rostock/Germany
September 04, 2015 4:54am

Sorry, there is still a problem. The method you described only works with an explicit iterator function. It doesn't work, if the iterator is a recursive function of the form n:=f(n-1), it means that the [n] in the current calculation only depends of the value used in the previous one.
Is there any solution? The question is: Can the current calculation access the value used in the previous calculation?

Regards,

Erich, Rostock/Germany
September 04, 2015 5:39am

Hi,

for pass the [n] in the other calc, let or cf or CustomList in CustomList, you can need one $variable
you can also not use the [n], instead, you use $var
CustomList ( 1 ; 10 ; "
Let ([
$Var = $Var ^ 2 ;
Cf = CalcRecursive ( Reset/continu $var)
....
]; """" )" )

I do not know your result, and calc depends on the results you want
may be if it's more simple if you send me by eMail, your calc and the result that you want

Agnes, Paris
September 04, 2015 6:08am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 2 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. color_convert_hex ( color_hex ; output_format )
  (Thu, Apr 27, 10:36pm)
2. color_convert_rgb_to_hex ( r ; g ; b )
  (Thu, Apr 27, 9:35pm)
3. color_convert_decimal ( color_decimal ; output_format )
  (Thu, Apr 27, 9:20pm)
4. ReformatArray ( valueList ; quoteStyle ; braceStyle ; newSeparator )
  (Thu, Apr 27, 8:12pm)
5. ContainsAllExact ( Text ; SearchStrings )
  (Wed, Apr 26, 12:23pm)
6. ContainsExact ( Text ; SearchStrings )
  (Wed, Apr 26, 12:17pm)
7. TimeCorrect ( TimeEntry )
  (Wed, Apr 26, 9:41am)
8. ar_rm_diacritics ( text )
  (Tue, Apr 25, 5:22am)

RSS Feed of Custom Functions