Quick Challenge
Richmond
richmondmathewson at gmail.com
Thu Aug 27 11:08:15 EDT 2015
On 08/27/2015 05:39 PM, David Bovill 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
>
IFF you are just working within the ASCII set that should be dead easy:
if you are using anything within the UniCode
standard I suspect you have no chance at all.
Richmond.
More information about the use-livecode
mailing list