And this should be:

on mouseUp

put script of image "xxx" into tScriptToChange

put 0 into tLineNumber

repeat for each line tLine in tScriptToChange

add 1 to tLineNumber

if "unicodeText" is in tLine then

put replaceText(tLine,"unicodeT","t") into line tLineNumber of tScriptToChange

end if

if "useUnicode" is in tLine then

put "--deprecated code removed (useUnicode)" into line tLineNumber of 
tScriptToChange

end if

end repeat

end mouseUp

> 16. nov. 2016 kl. 16.20 skrev Tore Nilsen <tore.nil...@me.com>:
> 
> I think this will be even faster. Put the script directly into a variable, 
> use a repeat for structure and replace text as needed directly in the 
> variable. You may not notice much of a speed improvement for smaller scripts, 
> but if the script is longer, this should execute faster than your version, as 
> both the "repeat for" structure is faster than the "repeat with" structure, 
> and replacing the text in a variable rather than in the field, should also be 
> faster.
> 
> Regards 
> Tore
>> 16. nov. 2016 kl. 13.13 skrev Richmond <richmondmathew...@gmail.com>:
>> 
>> So; here I am, as per usual, replying to my own message having found that 
>> nothing quite so elaborate was required:
>> 
>> /put empty into fld "fSSS1"//
>> //   put the script of img "xxx" into fld "fSSS1"//
>> //   put the number of lines of fld "fSSS1" into TERMINUS//
>> //   put 1 into QOUNT//
>> //   repeat until QOUNT > TERMINUS//
>> //      if line QOUNT of fld "fSSS1" contains "unicodeText" then//
>> //         put line QOUNT of fld "fSSS1" into PROCESST//
>> //         put replaceText(PROCESST,"unicodeT","t") into line QOUNT of fld 
>> "fSSS1"//
>> //      end if//
>> //      if line QOUNT of fld "fSSS1" contains "useUnicode" then//
>> //         put "--deprecated code removed (useUnicode)" into line QOUNT of 
>> fld "fSSS1"//
>> //         end if//
>> //         add 1 to QOUNT//
>> //      end repeat//
>> ///
>> Richmond.
>> 
>> On 6.11.2016 14:44, Richmond wrote:
>>> I wonder if there is a way to replace this:
>>> 
>>> set the unicodeText of fld "fDECODE" to (numToCodePoint(107) & 
>>> numToCodePoint(104))
>>> 
>>> with this:
>>> 
>>> *put (numToCodePoint(107) & numToCodePoint(104)) into fld "fDECODE"*
>>> 
>>> where /(numToCodePoint(107) & numToCodePoint(104))/ vary?
>>> 
>>> I have no great urge to do that sort of thing manually about 6 million 
>>> times.
>>> 
>>> Richmond.
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to