January 30, 200619 yr Newbies Can someone with more experience of custom functions help on this please? A field within a table is basically an html page containing the usual html code. A sample layout is below: %C+%the dog jumped over the moon%C-% Other page content and html code here %C+%then another dog tried as well%C-% The "%C+%" and "%C-%" tags denote the beginning and end of capitalisation (or use of FM's Proper function) and trying unsucessfully so far to create a function which act on all "starting tags" and find the "ending tag" and Capitalise all content between, then remove the start and end tag. Any clues or suggestions would be much appreciated Thanks!
January 30, 200619 yr Basically, you need something like this: 1. Put the entire text inside quotes 2. Substitute each "%C+%" with: "" & Proper ( " " 2. Substitute each "%C-%" with: "" ) & "" 3. Evaluate the result. I wrote this without testing and I may have a syntax error (it IS a bit tricky), but the principle should work.
January 30, 200619 yr Author Newbies That was quick veteran -) I was just checking out a similar same concept as in Bob Weaver's post using the substitute function here: http://www.fmforums.com/forum/showtopic.php?tid/149507/ where all field content is changed. Many thanks for this - I'll try playing with it now!
February 2, 200619 yr Author Newbies OK... Been playing with this for too long now with little result tho have no problems replicating it in a programable editor and seems a fairly basic routine. There *may* be a simpler way in FM but goes like this: (a) get to the field start (: search for %C+% (if not found - abort) and mark/grab the start position © continue until %C-% found (d) grab all content between %C+% and %C-% (inclusive) and Proper (capitalize) this (e) Substitute %C+% and %C-% with "" (f) Go back to field start and repeat until no further %C+%'s are found within the field. Any clues from folks with more FM custom function experience than I've got?
February 2, 200619 yr As I said, recursion is not really required here. I don't know why you had no results. This seems to do what you want: Evaluate ( Substitute ( Quote ( text ) ; [ "%C+%" ; "" & Proper ( "" ] ; [ "%C-%" ; "") & "" ] ) )
February 2, 200619 yr Author Newbies Could life be easier Comment? : Thank you so much for you help - it's much appreciated! This works perfectly! :thumbup:
Create an account or sign in to comment