.. highlightlang:: us .. index:: obj_load .. _obj_load: obj_load ======== .. us.tag obj_load NOTREADYENGLISH obj New410 Changed5100 Changed5603 :ref:`obj_load` loads an object saved with :ref:`obj_save` from the hard drive. .. function:: e = obj_load(obj, ssFilename) e = obj_load(obj, ssString) e = obj_load(obj, ssFileOrString, bString) .. us.return **Return Value** *e* is an error object (see :ref:`error_create`) if an error occurred of 0 if the function was successful. .. us.params **Parameters** .. uparam:: obj *obj* is the object created with :ref:`obj_create`. .. uparam:: ssFilename *ssFilename* is the complete file name of the saved object. .. uparam:: ssFileOrString *ssFileOrString* is the complete file name or a string with XML code saved using :ref:`obj_save`. .. uparam:: bString If the function is invoked with the XML code, **bString** must be set to 1. .. us.example **Example** :: obj = obj_create() obj.a = 123 obj.b = "Hello" obj.save("c:/test.xml"); obj2 = obj_create() e = obj2.load("c:/test.xml") if (e) { MessageBoxError(e.message); } Example 2: .. highlight:: none :: * o = [. a = 123, "Hello"] * o [. [1] = "Hello" a = 123 ] object (obj at 0x3E0DB38) * r = o.save("") * r Hello 123 * o1 = [.] * o1.load(r, 1) 0.0000 * o1 [. [1] = "Hello" a = 123 ] .. highlight:: us .. us.comment **Comment** The function can also load map files created with :ref:`MapSave`. Elements already existing the object will be overwritten by elements saved in the XML file. Elements existing in the object but not in the XML file are not removed or modified. .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2014.3 - Objects saved with :ref:`obj_save` in binary format can be loaded. * - 5.10.0 - New parameter *bString*. * - 4.1.0 - New .. seealso:: :ref:`overview-uniscript-objects`, :ref:`obj_save`, :ref:`error_create` :sub:`id-213018`