Function overview
Prototype
ValueIterator (
values )
Parameters
values The values to iterate over
Description
Tags:
ValueIterator
This function creates a value-iterator "object" that can iterate over a list of values. The returned reference is passed into the other value-iterator functions to manipulate it.
The iterator allows moving forward (via NextValue()), backwards (via PrevValue()) and can be reset to the beginning or end at any time.
Since its state is held in a global variable, it is persistent only for a single run of FileMaker, but across scripts and other calculations.
Examples
Sample input
ValueIterator(”ape¶beta¶grape¶jelly¶jam” )
Sample output
$$_tmp1
Function code
Let( iterName = "$$" & _tmpVarName;
Evaluate(
"Let( ["
& iterName & "[-1] = " & Quote(iterName) & ";"
& iterName & "[0] = " & Quote(values) & ";"
& iterName & "[1] = 0;"
& iterName & "[2] = " & ValueCount(values)
& "]; "
& Quote(iterName) & " )"
)
)
// ===================================
/*
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/165
Prototype: ValueIterator( values )
Function Author: The Shadow (http://www.fmfunctions.com/mid/34)
Last updated: 24 December 2008
Version: 1
*/
// ===================================
Let( iterName = "$$" & _tmpVarName; __LITBR__ Evaluate(__LITBR__ "Let( ["__LITBR__ & iterName & "[-1] = " & Quote(iterName) & ";"__LITBR__ & iterName & "[0] = " & Quote(values) & ";"__LITBR__ & iterName & "[1] = 0;"__LITBR__ & iterName & "[2] = " & ValueCount(values)__LITBR__ & "]; "__LITBR__ & Quote(iterName) & " )"__LITBR__ )__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/165__LITBR____LITBR__ Prototype: ValueIterator( values )__LITBR__ Function Author: The Shadow (http://www.fmfunctions.com/mid/34)__LITBR__ Last updated: 24 December 2008__LITBR__ Version: 1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
30 December 2008
31 December 2008
http://www.spf-15.com/fmExamples/
Download the 'Value Iterators' example and take a look. The value iterator basically holds the state of iteration through a list, so that it can be easily referenced throughout an application. It is persistent thru its use of global variables to provide storage.
Hope that's what you were looking for.
Shawn