Recoding: search and replace

Richmond richmondmathewson at gmail.com
Wed Nov 16 11:43:06 EST 2016


Thanks, but to be honest I'm not worried about speed: I can go and have 
a bath, listen to some music, and, heaven forfend (!), go and spend some 
time talking with my wife.

As Devawriter Pro is an ongoing project (7 years and counting) that has 
brought me almost exactl $300
so far the speed at which I work is neither here nor there. What I do 
NOT want to do is to have to
recode millions of line manually; that's all.

Richmond.

On 16.11.2016 17:20, Tore Nilsen wrote:
> 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 <richmondmathewson at 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 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





More information about the use-livecode mailing list