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

Fabien Bodard gambas.fr at ...176...
Sat Feb 27 11:58:11 CET 2010


an idea...

hresult!field=if(mycollection.exist(field), mycollection!field, null)

2010/2/27 richard terry <rterry at ...627...>:
> 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
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel
>




More information about the Devel mailing list