Subject: Re: Stripping blank spaces before and after a word. Help

Kay C Lan lan.kc.macmail at gmail.com
Sat Nov 4 10:20:12 EST 2006


On 11/3/06, Ken Ray <kray at sonsothunder.com> wrote:
>> Anybody have a good way to convert all text in a list to ALL
> > CAPS?  It would be nice to get a consistent look in the database.  Here is the
> > script I settled on.
> >
> >   repeat with x = 1 to the number of items of MyList
> >   put word 1 to -1 of item x of Mylist into item x of Mylist
> >   end repeat
>
> Try this:
>
>    repeat with x = 1 to the number of items of MyList
>       put toUpper(word 1 to -1 of item x of Mylist) into item x of Mylist
>    end repeat

I'm probably too late for this one, but also remember that SQL has the
"UPPER()" function. In your case it probably doesn't make a difference
as you are already repeating through each item so adding 'toUpper'
probably adds little overhead - I'm not sure how much is wasted on
trying to set numbers toUpper? In the future if you don't already have
a convenient repeat loop, the following will probably be quicker than
getting Rev to do the grunt work:

INSERT INTO test VALUES ('number','date','lower text','number','upper text')

all you need to do is amend it to

INSERT INTO test VALUES ('number','date','lower
text','number',UPPER('upper text'))

SQL does the grunt work and only on the data that matters:-)



More information about the use-livecode mailing list