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

Dave Herndon herndogy at sbcglobal.net
Thu Nov 2 11:04:38 CST 2006


Thanks Mark,
  I settled on this and it works SWEEEET !  Thanks For your help.  Now to finish it up.  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
   
  Then I run another script to turn MyList containing mydata1,mydata2,mydata3, into 'mydata1','mydata2','mydata3' for entry int the databse.  Perhaps I can do it all in the same repeat loop.  Get rid of the spaces, change the text to all caps and then wrap the data in 'single quotes' for SQL data entry if the data is not a number or a date.  Anybody wanna throw down on this one?
   
   
  Mark Wrote Dave,
I think you are looking for something like this

repeat for each item myVar in "var1,var2,var2"
   do "put word 1 to -1 of" && myVar && "into" && myVar
end repeat

or

repeat for each line myLine in fld 1
   put (word 1 to -1 of myLine) & cr after myList
end repeat
put word 1 to -1 of myList into fld 1

Best,

Mark

> Does anyone have a handy little script that could be put in a  
> repeat loop to evaluate either the contents of several fields, or a  
> comma delimitered list of variables, and strip any blank spaces  
> that may or may not exist from before and after the contents. To  
> ready the data for insertion into a database.  I am having an issue  
> with data being entered with spaces before of after the words,  and  
> then not showing up in a data query because of that.
>   I usualy insert the datra from several fields into a list such as
>   var1,var2,var3, etc before entering it into a database.
>   Thanks
>   Dave






More information about the use-livecode mailing list