Jane Austen's peculiarity

BNig bernd.niggemann at uni-wh.de
Wed Aug 12 09:25:05 EDT 2015


Hi Richmond,

in LC 7 you can use sentence as a text unit.
Since sentence seems your context it is tempting to use that

here is an adaption of the is/was handler returning the sentence number and
the sentence

Easy to read, easy to maintain and reasonably fast. Just paste the code into
a copy of your button "is / are"


-------------------------------------------------------
on mouseUp
   lock screen
   put the milliseconds into t
   put empty into fld "COOKED2"
   put empty into fld "STARTT"
   put empty into fld "STOPT"
   put "started : " & the long time into fld "STARTT"
   put fld "TEKST" into TEKST
   put fld "WERBS" into WERBS
   
   repeat for each line aVerb in Werbs
      put "is " & aVerb into tSearch1
      put "are " & aVerb into tSearch2
      put 1 into tCounter
      repeat for each sentence aSentence in TEKST
         if aSentence contains tSearch1 then
            put tCounter & space & aSentence & cr after tCollect
         end if
         if aSentence contains tSearch2 then
            put tCounter & space & aSentence & cr after tCollect2
         end if
         add 1 to tCounter
      end repeat
   end repeat
   
   put tCollect & cr & tCollect2 into field "COOKED2"
   put "finished : " & the long time into fld "STOPT"
   -- put the milliseconds - t 
   unlock screen
end mouseUp
--------------------------------------------------------

Kind regards
Bernd



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Jane-Austen-s-peculiarity-tp4694658p4694849.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list