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.

TextColour function

Featured Replies

Why dosn't this work:-

Case(1=1;TextColor ( "Red"; RGB (255 ; 0; 0);"Black" )

It displays nothing

But

Case(1=2;"Black";TextColor ( "Red"; RGB (255 ; 0; 0) ))

"Works" ie displays red in red.

Robert -

Is this the real calculation or have you simplified for here?

Seeing as 1 always equals 1 why not just put the text color function in.

Tha calculation:

Case ( 1 = 1 ; TextColor ( "Red" ; RGB ( 255 ; 0 ; 0 ) ) ; "Black" )

Produces the word Red in the color red.

Case ( 1 = 2 ; TextColor ( "Red" ; RGB ( 255 ; 0 ; 0 ) ) ; "Black" )

Produces the word Black in the color black.

I don't know why it would work differently for you.

Note your parentheses. The way you have it written, you are passing three arguments to the TextColor function. Now, i haven't worked in FM7 much; i know FM6 won't let you out of the calculation editor with such an error existing. I'd echo Andy's question of whether this is the exact calculation, but if it's not, try parsing it out in a programming style:

  

Case (

  • Author

You are correct my parenthesis was missing, BUT FileMaker didn't pick this up and allowed 3 ( and 2 ) in the calculation. A bug I assume.

Sure this is a bug?

Isn't the "3rd" parameter actually part of your Case statement. Stripping out the Case part of it, FMP complains that passing 3 parameters to the TextColor function is a bad calculation.

Yeah, i'd call that a bug, too. Geez, if they're going to prevent us from coding things directly, they have to give us SOMETHING in return (like formula validation)! smile.gif

Unless Neverland is right... but i don't think so (someone check me):

Case(1=1;TextColor ( "Red"; RGB (255 ; 0; 0);"Black" )

==sub 'foo' for 'RGB(255;0;0)'==

Case(1=1;TextColor ( "Red"; foo ;"Black" )

It looks, then, like we are passing 3 arguments to the TextColor function. But Neverland, you say that TextColor("Red";"RGB(255;0;0);"Black") is not accepted by FM, while Robert's initial calculation is? I'd test it myself, but don't have v7 within typing distance.

J

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.