visualiseNumbers ( )

Function stats

Average user rating
5.0000
102
219
9999
Support
FileMaker 8.5 +
Date posted
01 May 2009
Version
1
Recursive function
Yes

Author Info
 TimA

5 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

visualiseNumbers  ( content;   string;   value )


Parameters

content  


string  


value  


Description

Tags:  numbers visualise string  

I was looking to find a way to make a list or string of numbers be graphically represented.
Can't remember when GetValue was added - think it was 8.5

Examples

Sample input

visualiseNumbers ( "5¶4¶5¶8" ; "x" ; 3 )


Sample output

|xxxxx|xxxx|xxxxx|xxxxxxxx|

 

Function code

/*

Name:
visualiseNumbers

History:
Created by Tim Anderson, Tim Anderson Group
www.timanderson.co.uk
Creation Date: 29 April 2009


Purpose:
To convert a list of numbers into a text line of characters defined by the numbers

Parameters:
Content
string
value

Example:
visualiseNumbers ( "5¶4¶5¶8" ; "x" ; 3 ) gives |xxxxx|xxxx|xxxxx|xxxxxxxx|




Requires Other Custom Functions:
string.repeat(str;number)
If (number > 0 ;
str & If ( number > 1 ; string.repeat ( str ; number - 1) ; "")

Other Notes:
The value must always be the number of values-1.

Options:
None
*/
// visualiseNumbers( Content ; string; value)

Let(_NumVals=ValueCount(Content);

Case(_NumVals-value>_NumVals;"|";

"|"& string.repeat ( string ; GetValue(content; _NumVals-value)) & visualiseNumbers(content;string;value-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/219

    Prototype: visualiseNumbers( content; string; value )
    Function Author: TimA (http://www.fmfunctions.com/mid/102)
    Last updated: 01 May 2009
    Version: 1

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