.. highlightlang:: us .. index:: obj_set_str_return .. _obj_set_str_return: obj_set_str_return ================== .. us.tag obj_set_str_return ENGLISH obj New410 Changed5502 :ref:`obj_set_str_return` specifies the return value of :ref:`obj_lookup`. If a key does not exist, :ref:`obj_lookup` may return 0, an empty string or throw an exception. .. function:: nOld = obj_set_str_return(obj) nOld = obj_set_str_return(obj, nType) .. us.return **Return Value** *nOld* is the old value of *nType*. .. us.params **Parameters** .. uparam:: obj *obj* is the object created with :ref:`obj_create`. .. uparam:: nType .. list-table:: :header-rows: 1 * - nType - Description * - 0 - If a key does not exists :ref:`obj_lookup` returns the value 0.0. * - 1 - If a key does not exists :ref:`obj_lookup` returns an empty string (``""``). * - 2 - If a key does not exists :ref:`obj_lookup` throws an exception .. us.comment **Comment** The alternative syntax for ``obj_set_str_return(m, 2)`` is ``m.set_str_return(2)``. .. us.example **Example** :: obj = obj_create() obj.set_str_return(1) obj.a == "" .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.2 - Throws an exception, if *nType* is 2 and a object member does not exist. * - 4.1.0 - New .. seealso:: :ref:`overview-uniscript-objects`, :ref:`obj_lookup` :sub:`id-2095559`