Applying a style to text in development

Emmanuel Companys mcompanys at mac.com
Sun Jun 8 01:46:01 EDT 2003


Le samedi, 7 juin 2003, à 23:26 Europe/Paris, Dar Scott a écrit :

>
> On Saturday, June 7, 2003, at 02:15 PM, Emmanuel Companys wrote:
>
>> on enterInField
>>    get the selectedtext of me
>>    set textfont of it to <font name>
>>    set textcolor of it to <color name or the corresponding of  3 
>> digits>
>>    set textstyle of it to "bold"
>> end enterInField
>
> I changed selectedtext to selectedChunk and it works great!  Thanks!
>
> I can see I need to put get/it to better use; I would have used my own 
> variable.

Of course you could use any variable instead of it. Or even not use any 
varaible at all and repeat "the selectedChunk" instead; but this whould 
have the program repeat a job it's already done.

Any time the get-it solution is safe (no other command modifying it int 
the holder, for intance) I find it easier to write, read and debug.

Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 936 bytes
Desc: not available
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030608/09ab41c4/attachment.bin>


More information about the use-livecode mailing list