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.

Featured Replies

Howdy all:

I'm flummoxed. The following calculation works fine:

TextSize ( TextStyleAdd ( LABEL_WORKSPACE::Field1__lxt ; Uppercase + Bold ) ; LABEL_WORKSPACE::_g_Field1_FontSize__lxn )

However, when I replace the argument for the style change with a global field that has the same text (Uppercase + Bold),

TextSize ( TextStyleAdd ( LABEL_WORKSPACE::Field1__lxt ; LABEL_WORKSPACE::_g_Field1_StyleChoice__gxt ) ; LABEL_WORKSPACE::_g_Field1_FontSize__lxn )

...it doesn't change the text's format--it remains plain. I looked at the Help page and didn't see anything that says that the argument can't be a field, just that it has to be text.

Am I missing something, or the argument has to be text and not a field?

 

Ciao,

Rich

 

  • Author

I think I found a fix: if I stick the field reference inside the Evaluate command, i.e.,

TextSize ( TextStyleAdd ( LABEL_WORKSPACE::Field1__lxt ; Evaluate ( LABEL_WORKSPACE::_g_Field1_StyleChoice__gxt ) ) ; LABEL_WORKSPACE::_g_Field1_FontSize__lxn )

...it works. : P

27 minutes ago, WF7A said:

Am I missing something, or the argument has to be text and not a field?

The thing is that the argument is NOT text. Texts in calculations are quoted. The styles argument of the TextStyleAdd() function is actually a number - and Filemaker allows you to specify the number using a keyword.  

The keyword Uppercase represents the number 16 and keyword Bold stands for the number 256. The expression:

TextStyleAdd ( text ; Uppercase + Bold )

is the exact equivalent of:

TextStyleAdd ( text ; 272 )

If you want to allow users to specify the styles as text, then you must find a way to transform the text entry into a number before you pass it to the TextStyleAdd() function - as it seems you already did while I was writing this.

 

  • Author

Ah! That's good info to know, thank you. 

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.