| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Initiates deserialization of a group of variables of simple or complex data types.
HB_DeserialBegin( <cBinaryData> ) --> cFirstSerialdata
The function returns a binary character string.
Function HB_DeserialBegin() prepares a binary character string holding data of serialized variables for deserialization. Actual data is extracted from <cBinaryData> with HB_DeserialNext().
| See also: | HB_Deserialize(), HB_DeserialNext(), HB_Serialize() |
| Category: | Serialization functions , xHarbour extensions |
| Source: | rtl\hbsrlraw.c, rtl\hbserial.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example outlines when and where HB_DeserialBegin() is used in
// the serialization modules of xHarbour. Values of four different
// data types are serialized and converted back to their original data
// types.
PROCEDURE Main
LOCAL cBinary, cSerial, xValue
cBinary := HB_Serialize( "xHarbour compiler" )
cBinary += HB_Serialize( 123.45 )
cBinary += HB_Serialize( StoD( "20070201" ) )
cBinary += HB_Serialize( { 1, 2, { "a", "b" }, 3 } )
cSerial := HB_DeserialBegin( cBinary )
xValue := HB_DeserialNext( @cSerial )
DO WHILE xValue <> NIL
? Valtype( xValue ), ValToPrg( xValue )
xValue := HB_DeserialNext( @cSerial )
ENDDO
RETURN
http://www.xHarbour.com