colorized scripts

Jacques Hausser jacques.hausser at unil.ch
Tue Aug 26 09:19:24 EDT 2014


Thanks, Peter,

As I'm checking version 7.10 DP, your solution is not working... I rummaged into the "revNewScriptEditor" stack and found that "revSEColorize" doesn't exist anymore (or it's hidden somewhere else).
But it's even simpler! here the script of my button:

on mouseUp
   put the script of button "TestButton" into fld "FScript"
   _internal script colorize char 1 to (the number of chars of field "FScript") of field "FScript"
end mouseUp

... works perfectly ! (although I strictly don't know what an "_internal script" is). I guess it is not usable on a standalone.

Jacques



Le 26 août 2014 à 13:53, Peter M. Brigham <pmbrig at gmail.com> a écrit :

> Mark Weider came up with this trick, which I use in my library stack (a set of utility handlers, click on the name of a handler and the script is displayed in a field, properly colorized).
> 
>   put thisScript into fld "script"
>   -- now colorize script
>   -- thanks to Mark Wieder, of the useRev listserv
>   put the number of lines of field "script" into tNum
>   send "sePrefInit" to stack "revNewScriptEditor"
>   send "revSEColorize thisScript,default" to stack "revNewScriptEditor"
>   _internal script colorize line 1 to tNum of field "script"
>   -- how he figured this out, I don't know
> 
> -- Peter
> 
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
> 
> On Aug 26, 2014, at 5:53 AM, Jacques Hausser wrote:
> 
>> I want a button to automatically put the script of any control in a field, showing the script editor's colors... I'm probably completely dumb, but I didn't find the trick.
>> Thanks for every hint!
>> 
>> Jacques
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

******************************************
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel: 	++ 41 22 366 19 40
mobile:	++ 41 79 757 05 24
E-Mail:	jacques.hausser at unil.ch
*******************************************





More information about the use-livecode mailing list