I have spent hours trying to write a function for error checking a csv file. In 
my function I want to check each field, and if there is an error put the 
errored text in a structure in an array, the array index will be relevant to 
the current row id of the query i am looping, and there will be a structure of 
the errors in each array element ( if that makes sense )

In total I have 24 fields of each row to check, hence me wanting to put the 
errors in an array so that I can provide an error report to the person 
uploading the csv file.

I have no idea how to test for the existance of the structure for each item i 
want to test, i create the array first, then i will check each type of field, 
but i dont want to issue a 
<cfset errorArray[#rowid#]=StructNew()> if one is already created.

<cffunction name="ValidateCSV" returntype="array">
        <cfargument name="rowid">
        <cfargument name="medicarenumber">
        <cfargument name="firstname">
        
                <cfset errorArray=ArrayNew(1)>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185911
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to