Getting data prepped for database entry.

Jim Ault JimAultWins at yahoo.com
Thu Nov 2 19:02:29 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 

Check the archives to see recent posts on the use of 'is not a date'.  This
is not a reliable check, even though it sounds like it.

perhaps use a try structure to trap ....
try
   convert theVar to dateItems
catch errorValue
   answer "something is not a date here.."&& errorValue
  --take appropriate action... add ' marks
end try

Jim Ault
Las Vegas

On 11/2/06 2:36 PM, "John Craig" <jc at spl21.net> wrote:


> 
> 
> 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
>> 
>>   
> 
> _______________________________________________
> 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