list.rand ( )

Function stats

Average user rating
29
91
9999
Support
FileMaker 7.0 +
Date posted
04 December 2008
Last updated
07 December 2008
Version
Recursive function
No

Author Info
 Genx

18 functions

Average Rating 4.1

author_avatar



 

Function overview

Prototype

list.rand  ( listValues )


Parameters

listValues  A Pilcrow (¶) delimited set of values


Description

Tags:  PHP   List  

This function is part of a larger series of functions seeking to implement equivilant's of PHP's native array_* functions. This particular function emulates PHP's array_rand() (see http://php.net/manual/en/function.array-rand.php)

Examples

Sample input

List.Rand( "Mary¶Kate¶Ashley" )


Sample output

Kate

 

Function code

MiddleValues ( listValues ; Int(Random * ValueCount(listValues)) + 1 ; 1 )

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

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

    Prototype: list.rand( listValues )
    Function Author: Genx (http://www.fmfunctions.com/mid/29)
    Last updated: 07 December 2008
    Version: 1.2

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

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (28)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (13)
Filter  (12)
Layout Objects  (11)
Design  (10)
Array  (8)