Hi.
I'd like to know what happens when you try to get, for example, an integer from an SFSObject with a key which is not defined for this object.
For the Java version, getInt will return the associated element or null if the key is not found. Is it the same with the C# API? Or will I get an exception?
Thanks.
[RESOLVED] SFSObject and key not found
[RESOLVED] SFSObject and key not found
Last edited by LeMageFou on 29 Mar 2012, 09:22, edited 1 time in total.
Re: SFSObject and key not found
If you use SFSObject.GetInt(string key), and the "key" does not exist, the C# API will return a 0 (not null and no exception). This is true with the other Get commands as well.
To check the object, you can use SFSObject.ContainsKey(string key) which will return a bool (false if its not found).
To check the object, you can use SFSObject.ContainsKey(string key) which will return a bool (false if its not found).
Re: SFSObject and key not found
Thanks for the reply.
Who is online
Users browsing this forum: No registered users and 70 guests