From: Mark M. <mie...@gm...> - 2013-01-20 20:29:06
|
On Sun, Jan 20, 2013 at 11:12 AM, Staffan Tylen <sta...@gm...>wrote: > > I think it's important that whatever method is chosen, the >>> stringValueForNil option be included in one way or another. >>> >> >> It could just be the empty string always. >> >> > Well, it could, but the documentation for SQLite is very specific when it > comes to the NULL value, which is translated to .NIL by ooSQLite. NULL is > NOT the same as the empty string, rather NULL means 'undefined'. > That's true about SQLite and SQL in general. > So by always setting the empty string one looses the possibility > to differentiate between NULL and an empty string. > In a list-view you have to set the item text to some text. If you always set the empty string to NULL in your database, then the empty string in your list-view would always represent NULL. Anyway, I'm not really arguing against having an argument to specify what string to use for the list-view if an array index is .nil, I'm just saying if you are looking for a way to optimize list-view insertion time for a large number of items, then you will get better performance by not being able to specify alternate strings to use. You will get better performance by having a standard string that is always used. For the specific case you brought up, the optimal thing would be for the string to be "The NIL object" There would be 0 extra machine instructions for that. -- Mark Miesfeld |