Quick Challenge

Mike Bonner bonnmike at gmail.com
Thu Aug 27 11:15:19 EDT 2015


Rogers, using truewords

on mouseUp
   set the caseSensitive to true
   put "Mary had a little LAMB. Its fleece was WHITE as cocaine.
Everywhere that
Mary went, she would shout, WINNING!" into tWords
   repeat for each trueword thisWord in tWords
      if thisWord is toUpper(thisWord) then put thisWord & cr after
tCapWords
   end repeat
   set the caseSensitive to false
   answer tCapWords
end mouseUp

On Thu, Aug 27, 2015 at 9:09 AM, Roger Eller <roger.e.eller at sealedair.com>
wrote:

> A silly variation...
>
> on mouseUp
>    set the caseSensitive to true
>    put "Mary had a little LAMB. Its fleece was WHITE as cocaine. Everywhere
> that Mary went, she would shout, WINNING!" into tWords
>    replace "." with empty in tWords
>    replace "," with empty in tWords
>    replace "!" with empty in tWords
>    repeat for each word thisWord in tWords
>       if thisWord is toUpper(thisWord) then put thisWord & cr after
> tCapWords
>    end repeat
>    set the caseSensitive to false
>    answer tCapWords
> end mouseUp
>
>
>
> On Thu, Aug 27, 2015 at 10:39 AM, David Bovill <david at viral.academy>
> wrote:
>
> > So what's the quickest way to tell is a word is all caps in Livecode? I
> > guess there are a lot of ways to skin a cat with this one. This is what
> I'm
> > tinkering with:
> >
> > function text_IsCaps someText
> > >    put "\b[A-Z]+\b" into someReg
> > >    return matchtext (word 1 to -1 of someText, someReg, anyThing)
> > >
> > >    repeat for each char testChar in someText
> > >       put chartonum (testChar) into someCharNum
> > >       if someCharNum >= 65 and someCharNum <= 90 then
> > >          return false
> > >       end if
> > >    end repeat
> > >    return true
> > > end text_IsCaps
> >
> >
> _______________________________________________
> 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