obj_set_str_returnΒΆ
obj_set_str_return specifies the return value of obj_lookup. If a key does not exist, obj_lookup may return 0, an empty string or throw an exception.
-
nOld = obj_set_str_return(obj)
-
nOld = obj_set_str_return(obj, nType)
Return Value
nOld is the old value of nType.
Parameters
-
obj
obj is the object created with obj_create.
-
nType
nType Description 0 If a key does not exists obj_lookup returns the value 0.0. 1 If a key does not exists obj_lookup returns an empty string ( ""
).2 If a key does not exists obj_lookup throws an exception
Comment
The alternative syntax for obj_set_str_return(m, 2)
is m.set_str_return(2)
.
Example
obj = obj_create()
obj.set_str_return(1)
obj.a == ""
History
Version | Description |
---|---|
R2013.2 | Throws an exception, if nType is 2 and a object member does not exist. |
4.1.0 | New |
See also
id-2095559