Brian Dunning's FileMaker Custom Functions

Static_Length ( FillChar ; Len ; String ; LR_Flag )

Turns any string to a fixed length adding Leading or Trailing Char

  Average rating: 4.4 (34 votes) Log in to vote

Antonios M. Kesmetzis   Antonios M. Kesmetzis - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Static_Length ( * ; 15 ; 10.0102 ; 2)
Static_Length ( * ; 15 ; 10.0102 ; 1)
  Sample output:
********10.0102

10.0102********

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Parameters
String: Any number or text
FillChar: Any character to fill
Len: The desired legth of the resulted string
LR_Flag: When its value is 1 the number is padded Left, i.e. Leading chars are added
When its value is 2 the number is padded Right, i.e. Trailing chars are added

The functions returns a string of fixed length, defined by Len, with Leading or Trailing chars, defined by FillChar
and the value of LR_Flag

If the Length of the String exceeds Len the string unaltered is returned

 

Comments

Log in to post comments.

 

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

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: