August 12, 200520 yr I have the following script I'm using to determine the textColor of a field based on its contents: If [ testData::r001 = "√" ] Set Field [ testData::r001; TextColor ( testData::r001 ; RGB ( 25 ; 125 ; 50 ) ) ] Else Set Field [ testData::r001; TextColor ( testData::r001 ; RGB ( 235 ; 30 ; 35 ) ) ] End If You'll note that I'm applying this to field "r001"...I have 100 of these types of fields ("r001" - "r100"). The question is can I apply this script to all of them without having to repeat the script 100 times? Thanks in advance for any assistance.
August 12, 200520 yr Now that I think about it, you should probably just make each field an auto enter calc with "do not replace existing value for field (if any)" unchecked; If ( r001 = "√"; TextColor ( r001 ; RGB ( 25 ; 125 ; 50 ) ); TextColor ( r001 ; RGB ( 235 ; 30 ; 35 ) ) )
August 12, 200520 yr Queue could you explain 1670450; 15408675. This is an alternative way to select color instead of 000;000;000?
August 12, 200520 yr RGB( x; y; z ) = 256^2 * x + 256 * y + z It is merely the decimal equivalent of the quadratic represented as RGB( ).
August 12, 200520 yr Author Sorry...but I'm not sure I'm understanding any of the responses so far. Perhaps I worded my question poorly. I'm not having trouble getting the field to become the color I desire using the script I gave in the original post. What I was curious about was if there was a way to apply the textColor formatting to a group or range of fields without having to copy/paste the script 100 times and replace the field names.
August 12, 200520 yr Yes, see attached. Slobey was suggesting that you make it easier on yourself and use an auto-enter calc with 'do not replace existing value' deselected for each of your rXXX fields. You will have to update your existing records. But any new ones will automatically change the color of the text appropriately when data is entered or modified. mKirk.zip
August 12, 200520 yr Author Ah! It was the... TextColor( GetField(Get(ActiveFieldName)); If( Get(ActiveFieldContents) = "√"; RGB ( 25 ; 125 ; 50 ); RGB ( 235 ; 30 ; 35 ) ) ) ...in a loop that I was missing. Thanks!
Create an account or sign in to comment