Page 1 of 1

TextColor glitch

Posted: Sun Mar 02, 2014 1:47 pm
by Maxiogee
Why does the textcolor of a field return empty when no textcolor has been set?

I set the textcolor of the first line of text in field 1 to "255,0,0"
I have left the textcolor of line 2 unchanged from the default.

I have this script in a button

Code: Select all

on mouseUp
   repeat with a = 1 to 2
      put "/" & the textcolor of line a of field 1 & "/" into line a of field 2
   end repeat
end mouseUp
This is the result

Image

Re: TextColor glitch

Posted: Sun Mar 02, 2014 2:01 pm
by Klaus
Hi,

well, that is correct bahavior :D

If you do not set a property explicitely for an object, it inherits that property from:
its enclosing group, if any -> card -> stack -> home stack, if in IDE - engine
In that case that property is in fact EMPTY!

If you want to get the inherited property, use the keyword EFFECTIVE, that will do what you want:

Code: Select all

on mouseUp
   repeat with tLine = 1 to 2
      put "/" & the EFFECTIVE textcolor of line tLine of field 1 & "/" into line tLine of field 2
   end repeat
end mouseUp
Best

Klaus