Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CustomText Formatting Within Defined Tag

Featured Replies

  • 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!

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.

  • 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!

  • 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?

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-%" ; "") & "" ]

)

)

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.