Passing Lists

Geoff Canyon gcanyon at inspiredlogic.com
Wed Jan 15 20:31:01 EST 2003


On Wednesday, January 15, 2003, at 12:06 PM, Jeanne A. E. DeVoto wrote:

> At 11:08 AM -0800 1/15/03, Richard Gaskin wrote:
>> This raises a point:  when styles for a specified chunk are mixed, 
>> getting
>> the textstyle returns "mixed".  That's not so bad and I understand 
>> why it
>> does that, but in such cases you cannot set the textstyle to the same 
>> value
>> you get from querrying it.
>>
>> Any suggestions for a more self-constent form that would allow simple 
>> syntax
>> like this to work?:
>>
>> set the textstyle of btn 1 to the textstyle of char 20 to 30 of fld 1
>
> It depends: what do you want the above statement to do? A button can't 
> have
> mixed text: the button's entire label has to be a single style or set 
> of
> styles.
>
> So if char 20 to 25 of the field is bold italic, say, and char 26 to 
> 30 is
> condensed underline, the statement above is ambiguous: do you want the
> button to be bold italic? Condensed underline? Bold italic condensed
> underline?
regards,

Geoff Canyon
gcanyon at inspiredlogic.com
I think the answer is never set the style of something that can have 
only one style to the style of something that can have multiple styles. 
In other words, the above command should be:

set the textstyle of btn 1 to the textstyle of char 20 of fld 1

Either the text run has a consistent style, in which case the result is 
identical to the earlier command, or the text run has a mixed style, in 
which case you are protected from that fact.

OR: you want to do something entirely different if the text run's style 
is mixed, in which case test for it.

I hope this helps. Feel free to contact me if you have any further 
questions.

regards,

Geoff Canyon
Revolution Support
--
Geoff Canyon <geoff at runrev.com> <http://www.runrev.com/>
Runtime Revolution Limited - The Solution for Software Development
Tel: +44 (0) 870 747 1165.  Fax: +44 (0)1639 830 707.





More information about the use-livecode mailing list