Shopping Cart

Search:

Signup

Contact

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

# FileMaker Pro Custom Functions

Backwards( _Field )

Rate this function:

Discuss this Custom Function

Alexander Baier, FM Tutorial
http://www.fm-tutorial.de

return a string backwards (mirror writing)

Sample Input:
 Backwards ( "Hello" ) Backwards ( "12345" )
Sample Output:
 olleH 54321

Then copy & paste into FileMaker Advanced's Edit Custom Function window.

## Description:

This recursive function returns any string backwards.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

## Discuss:

- Calculations of checksums

- mathematical operations or mathematical curiosities

e.g (

731 - 137 = 594 + 495 = 1089

this algorithm is valid for three-digit numbers (n>m>p))

or simply for mischief :-)

Alexander Baier, Germany
May 23, 2013 11:24pm

concise mode:

If ( Length ( _Field ) ; Backwards ( Right ( _Field ; Length ( _Field ) - 1 ) ) ) & Left ( _Field ; 1 )

Daniele Raybaudi, Rome
May 27, 2013 10:49am

Don't you mean "feihcsim"? :)

Vinny, Somerset, NJ USA
May 31, 2013 8:29am

Beautiful function very usefull to me. I am not at all stupid, but I could never make this one myself. Can somone please explain to me why it's working?

THX a lot

John Segers, Tilburg, Netherlands
June 10, 2015 6:20am

Just found this function and it was exactly what I was looking for. As far as 'why'? It worked wonders for my need to reverse a string of characters so that I could feed that into the Code() function (which reverses the characters itself in its output). I needed those code points to be in the proper word order, not the reversed Code() output order.

It works by passing in an ever diminishing right-hand list of characters to itself, and then returns the left hand side of things once it reaches the end.

So say we called Backwards ("abc").

1) Backwards ("abc") => _field = "abc"
1A) Length > 0, so call Backwards ("bc") & "a"

2) Backwards ("bc") => _field = "bc"
2A) Length > 0, so call Backwards ("c") & "b"

3) Backwards ("c") => _field = "c"
3A) Length > 0, so call Backwards ("") & "c"

4) Backwards ("") => _field = ""
4A) Length NOT >0, so return Left("") (which is empty)

4A returns ("") to 3A => "" & "c" = "c"
...which returns "c" to 2A => "c" & "b" = "cb"
...which returns "cb" to 1A => "cb" & "a" = "cba"

I think the calculation could be modified a bit, but haven't tested anything. It works as it is. It isn't Tail recursion, so you wouldn't want to pass strings longer than 10,000 characters to it.

Justin, Salem, Oregon
June 17, 2015 12:31pm