[Gambas-devel] Another attempt to sort out empty string being interpreted as null

richard terry rterry at ...627...
Sat Feb 27 10:23:18 CET 2010


Hi List,

We debated this before and though some persons understood what I was saying, I 
don't think there was any resolution, so this time I've got a little screen 
shot to visually demonstrated the problem which is.

When one sets a collection member to any empty sting ""  gambas beleives this 
is the same as null and  removes the item from the collection

ie mycollection!my_key = "Fred" is valid
   mycollectioin!my_key = "" removes the key from the collection, instead of 
setting its value to an empty string (ie string with no characters.

The implications of this in data saving as illustrated by the picture are as 
follows

Here, the persons name/firstname/salutation were Smith/Stephanie/Steph, this 
record was saved to the database. however I decided to remove salutation. As 
gambas then sets this key to null - effectively removing it from the 
collection, the field in the collection is not updated, and the original value 
is left intact - ie 'steph' in the database field 'saluation', is not re-set 
to an empty string.

I really wonder what can be done about this.

REgards

Richar




More information about the Devel mailing list