Steve,
That is not answering my question.
I can understand what you are doing, but I asked the question because of
this
if (position GT query.recordCount) {
arrayResize( columnStruct[columns[c]], rowCount);
arraySet( columnStruct[columns[c]], position, position,
IIF(structKeyExists(rowData, columns[c]), "rowData[columns[c]]", "''") );
}
To me that is the same as ArrayAppend, and I am curious why you didn't just
use ArrayAppend at this point. The rest makes perfect sense. And that is not
in the comments as to why you did not used ArrayAppend.
Because this would do the exact same thing you are doing.
arrayAppend(columnStruct[columns[c]], IIF(structKeyExists(rowData,
columns[c]), "rowData[columns[c]]", "''") );
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Steve Onnis
Sent: Thursday, 15 May 2008 11:40 AM
To: [email protected]
Subject: [cfaussie] Re: queryAddRow
Its in the comments:)
I made the function so you can insert the row anywhere in the recordset, not
just at the end of at the start. If you use arrayInsertAt() and the position
is larger than the actual size of the array then it fails so I had to resize
the array and then use arraySet() because arrayInsertAt() would add a new
element which I didn't want to do because the array was at the right size
after the resize.
ArrayAppend() would just "append" an element to the array where if the new
row was at position 10 and the query only had 5 records then you would have
to call arrayAppend() a few times to get the elements in there.
Steve
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Andrew Scott
Sent: Thursday, 15 May 2008 10:40 AM
To: [email protected]
Subject: [cfaussie] Re: queryAddRow
Steve,
Can you explain why you used, ArrayResize() and ArraySet() instead of
ArrayAppend()?
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---