Question
Blank entries in a list.
Let's say I have a list:
John,Doe,11-01-08,,red,Jane,Doe,11-15-08,circle,blue
I'm breaking up this long list into 2 separate lists storing the individual lists in array values:
MyArray[1] = John,Doe,11-01-08,,red
MyArray[2] = Jane,Doe,11-15-08,circle,blue
Then I'm looping over the array pulling each individual list and I'm trying to insert the data into a DB. I simply loop over the list and put them in FORM elements so I can use CFINSERT (which may be my first problem.
My problem is when I'm using ListGetAt and I reference position number 4, if there is no data in that position it skips and pulls the next available position with data. So, ListGetAt(MyArray[1],4) pulls a value of red instead of Null or blank.
The desired effect is when there is an empty field in the list that <NULL> is entered in the DB instead of skipping the blank field and inserting the next available data.
As I mentioned before I probably should just avoid using the cfinsert, but it was just a quickest point from A and B. Any ideas?
Paul
John,Doe,11-01-08,,red,Jane,Doe,11-15-08,circle,blue
I'm breaking up this long list into 2 separate lists storing the individual lists in array values:
MyArray[1] = John,Doe,11-01-08,,red
MyArray[2] = Jane,Doe,11-15-08,circle,blue
Then I'm looping over the array pulling each individual list and I'm trying to insert the data into a DB. I simply loop over the list and put them in FORM elements so I can use CFINSERT (which may be my first problem.
My problem is when I'm using ListGetAt and I reference position number 4, if there is no data in that position it skips and pulls the next available position with data. So, ListGetAt(MyArray[1],4) pulls a value of red instead of Null or blank.
The desired effect is when there is an empty field in the list that <NULL> is entered in the DB instead of skipping the blank field and inserting the next available data.
As I mentioned before I probably should just avoid using the cfinsert, but it was just a quickest point from A and B. Any ideas?
Paul
