FixValues ( )

Function stats

Average user rating
291
307
9999
Support
FileMaker 7.0 +
Date posted
11 May 2011
Last updated
03 June 2011
Version
Recursive function
No

Author Info
 Ronnie

1 functions

Average Rating None

author_avatar



 

Function overview

Prototype

FixValues  ( valuelist;   prefix;   suffix )


Parameters

valuelist  a list of carriage return-delimited values


prefix  any desired text


suffix  any desired text


Description

Tags:  Value List  

Returns valuelist with each value prefixed and suffixed with the specified values. If a prefixed-only value list is desired, provide an empty suffix text and vice versa.

Examples

Sample input

FixValues ( "one¶two¶three" ; "- " ; "!" )


Sample output

- one!
- two!
- three!

 

Function code

Let ( [
// adding prefix
theList = Substitute ( prefix & valuelist ; "¶" ; "¶" & prefix);

// adding suffix
theList = Substitute ( theList & suffix ; "¶" ; suffix & "¶" )
];

theList

)

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

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

    Prototype: FixValues( valuelist; prefix; suffix )
    Function Author: Ronnie (http://www.fmfunctions.com/mid/291)
    Last updated: 03 June 2011
    Version: 2.0

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

 

Comments

comment
02 June 2011



You could do this non-recursively with Substitute(), e.g.

Substitute ( listOfValues & "¶§" ; [ ¶ ; suffix & ¶ ] ; [ "¶§" ; "" ] )
  General comment
Ronnie
03 June 2011



You're absolutely right. Don't know what I was thinking.
  General comment

 

 

 

 

 

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)