Brian Dunning's FileMaker Custom Functions

ChgWordOccWNums F1 ( _list ; F1StartNum ; ChgWord )

Change word occurrences in a list with consecutive numbers

  Average rating: 4.5 (33 votes) Log in to vote

Pavle Ancevski   Pavle Ancevski
NYHTC PAN
http://NA.com

Share on Facebook Share on Twitter

  Sample input:
_list =
"Vacation
Vacation
Sick
Worked
Vacation
Weekend
Weekend"
F1StartNum=5
ChgWord = "Vacation"
  Sample output:
"5
6
Sick
Worked
7
Weekend
Weekend"

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

Changes all occurrences of ChgWord value in the list of values with consecutive numbers starting with F1StartNum.
This works with list of values (expl, one week) but can be expanded easily.
To change another word with another starting number, you'll need another field for start number, field for the word you want to replace, and another custom function like this which will look at this custom function's field. That means as soon first cust. function will change "vacation" days in my expl., second one will look at that field and apply the same function but now for "worked" words. That way in a list you can see how many days of vacation person took (consequently, F1StartNum can be the last vacation num), and the amount of days they worked so far this year.

 

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.

Under construction. Email me your wish list for improvements.