[Gambas-user] store a emtpy string in a collection key? how ?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Thu Jun 14 17:20:57 CEST 2018


hi Tobias and all, i review the JSON component and see that:

If IsNull(Value) Then Value = JSON.Null

and the JSON module has this that i dont know where i put in my new
collection class:

Public Sub _init()

  $vNull = VarPtr($vNull) '

End

and then when read try to detect the JSON.null and if detected set the
return to null

so if i inherits and make my onw collection class like json module does?
jus i copy the same code as JSON componente will work? where i must put the
init code of the null json value?


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2018-06-13 16:27 GMT-04:00 PICCORO McKAY Lenz <mckaygerhard at gmail.com>:

> 2018-06-13 15:36 GMT-04:00 Tobias Boege <taboege at gmail.com>:
>
>> The empty string is equal to Null in Gambas and assigning Null to a
>> collection slot deletes it. You can get around this limitation, but you
>> have to create the logic yourself.
>>
> ohh  god dam!
>
>>
>> For example JSONCollection [1] from gb.web allows you to store a Null-ish
>> value, but instead of Null itself, you have to store the special token
>> JSON.Null (which is actually not Null, if you're still with me).
>>
> i got it, that special value permits to store null and not delete the key!
>
> damm! i need something like php array does!
>
> this king of "misc" stop gambas gain force in web/app
>
> umm ok thanks Tobiaas!
>
>
>>
>> Regards,
>> Tobi
>>
>> [1] http://gambaswiki.org/wiki/comp/gb.web/jsoncollection
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180614/99c3e5ba/attachment.html>


More information about the User mailing list