Function overview
Prototype
PrevValue (
valueIter )
Parameters
valueIter The value-iterator to iterate over
Description
Tags:
ValueIterator
This function uses a value-iterator "object" that is created with the ValueIterator function.
This function provides a backward iterator over the list of values.
The forward iterator is called NextValue().
Examples
Sample input
PrevValue( ResetToEnd( ValueIterator( "ape¶bear¶jam" ) ))
Sample output
jam
Function code
Let( [ currentIdx = _getVariable( valueIter; 1 );
values = _getVariable( valueIter; 0 ) ];
If ( currentIdx > 0;
Let( [ currentIdx = currentIdx-1;
prevValue = GetValue( values; currentIdx );
jnk = _setVariable( valueIter; 1; currentIdx )
];
prevValue
)
)
)
// ===================================
/*
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/167
Prototype: PrevValue( valueIter )
Function Author: The Shadow (http://www.fmfunctions.com/mid/34)
Last updated: 24 December 2008
Version: 1
*/
// ===================================
Let( [ currentIdx = _getVariable( valueIter; 1 );__LITBR__ values = _getVariable( valueIter; 0 ) ];__LITBR____LITBR__ If ( currentIdx > 0;__LITBR__ Let( [ currentIdx = currentIdx-1;__LITBR__ prevValue = GetValue( values; currentIdx );__LITBR__ jnk = _setVariable( valueIter; 1; currentIdx )__LITBR__ ];__LITBR__ prevValue__LITBR__ )__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/167__LITBR____LITBR__ Prototype: PrevValue( valueIter )__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.