Getting data prepped for database entry.

John Craig jc at spl21.net
Thu Nov 2 16:36:47 EST 2006


You could use;

if item x of Mylist is not a number and item x of Mylist is not a date then
  do the string bits...


JC


Dave Herndon wrote:
>   This script pretty much gets the job done.  Stripps unwanted spaces before and aft, changes mixed or small caps to ALL CAPS, and makes ready the data for SQL data entry by wrapping the list items with 'singlequotes'  
>    
>   on mouseUp
>   put field "data" into MyList
>   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
>   put "'" & item x of Mylist & "'" into item x of mylist
>   end repeat
>   put the toUpper of Mylist into MyList
>   put Mylist into field "recip"
>   end mouseUp
>   the script changes 
>   davo, davo , davo Herndon , davo,davo,davo , davo , davo, 
>    TO
>   'DAVO','DAVO','DAVO HERNDON','DAVO','DAVO','DAVO','DAVO','DAVO',
>    
>   Now if I can just check to see if the item is a number or a date and not do the single quote operation on those items I will be set.  As a work around I  have beem carefull to leave those items as the last items in the list and do a partial operation, say there are 6 items in the list to be added to a database record and the last two items are dates. 
>    
>   as in varchar1,varchar2,varchar3,varchar4,date1,date2
>    
>   repeat with x = 1 to 4
>   put "'" & item x of Mylist & "'" into item x of mylist
>   end repeat
>   returns 'varchar1','varchar2','varchar3','varchar4',date1,date2
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>   




More information about the use-livecode mailing list