|
|
|
|
|
- Deserialization
- Speed
- Limitations
Deserialize (Function) In french: Désérialise Deserializes a buffer or a character string containing the data from a class, structure, array (including an associative array), queue, stack, list or advanced variable ( gglCalendar, for example), as well as their subelements.
MyArray is array of strings
bufResult is Buffer
Add(MyArray, "WINDEV")
Add(MyArray, "WEBDEV")
Add(MyArray, "WINDEV MOBILE")
Serialize(MyArray, bufResult, psdJSON)
MyRebuiltArray is array of strings
Deserialize(MyRebuiltArray, bufResult, psdJSON)
Syntax
Deserialize(<Variable> , <Buffer> , <Parameters>)
<Variable>: Variable type Structure, class, array, queue, list or stack variable. - For a structure or a class, this variable must be allocated.
- For an array, a queue, a list or a stack, this variable is automatically allocated during the deserialization.
The deserialization will be performed in this variable. <Buffer>: Ansi character string or buffer Variable that contains the serialized data. A variable name must be specified. <Parameters>: Integer constant Type of deserialization (must correspond to the type chosen for the serialization): | | psdBinary | Binary deserialization.
| psdBinaryFormat16 | Binary deserialization compatible with version 16. This format must be used if an application in version 17 or later must share data with an application in version 16 or earlier. This format must not be used in Unicode mode. | psdJSON | Deserialization in JSON format. | psdXML | XML deserialization with reference to sub-objects. Reminder: This type of serialization/deserialization allows you to use the XML format as storage and exchange modes between applications written in WLanguage. | psdXMLAggregated | XML deserialization with direct aggregation of sub-objects. Remark: The psdXMLAggregated serialization mode allows you to easily generate a standard XML file to exchange data with other systems. The psdXMLAggregated deserialization mode is available. However, the WLanguage elements (variants, arrays, derived classes, etc.) will be different from the original elements. |
Remarks Deserialization The deserialization of a variable of type Array, Queue or Stack deletes the contents of the element. If there are additional members in the structure or in the class: - if a structure or a class is deserialized: additional members keep their values from before the deserialization.
- if an array of structures or classes is deserialized: additional members take the default value of the member type.
If there are additional members in the serialized buffer, they are ignored during the deserialization. To deserialize an untyped dynamic array, it must be allocated beforehand. To deserialize a class or a structure containing an untyped dynamic array, this array must be allocated beforehand. The wd300xml.dll or wp300xml.dll library is necessesary to deserialize an XML document. An advanced variable that was serialized with a French version of the product (and whose names and properties are in French in the serialization buffer) can be deserialized by an English version of the product (and conversely). In the advanced variables: - the read-only properties cannot usually be deserialized.
- the write-only properties cannot usually be serialized.
Special cases are noted in the documentation for each type. Speed Binary deserialization is faster than XML deserialization.
Related Examples:
|
Unit examples (WEBDEV): The Serialize/Deserialize functions
[ + ] This example explains how to use the WLanguage functions Serialize and Deserialize. The serialization consists in saving a variable, an object, a structure, an array or any other element in a buffer. Then, this buffer can be saved on disk or sent by socket. This allows for the persistence of objects. The Deserialize function is used to rebuild an object, an array or a structure from a buffer.
|
|
Unit examples (WINDEV): The Serialize/Deserialize functions
[ + ] Using the WLanguage Serialize and Deserialize functions The serialization consists in saving a variable, an object, a structure, an array or any other element in a buffer. Then, this buffer can be saved on disk or sent by socket. This allows for the persistence of objects. The Deserialize function is used to rebuild an object, an array or a structure from a buffer.
|
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|