xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_DeserializeSimple()

Deserializes values of simple data types.

Syntax

HB_DeserializeSimple( <cBinaryData> ) --> xValue

Arguments

<cBinaryData>
This is a character string obtained from a call to HB_Serialize(). It holds the binary data of a previously serialized variable of data type C, D, L, M, N or U. Refer to function Valtype() for data type encoding.

Return

The function returns the deserialized value.

Description

Function HB_DeserializeSimple() is optimized for deserializing simple data types only. These are Character, Date, Logic, Memo, Numeric and undefined (NIL). Complex data types (Array, Code block, Hash and Object) must be deserialized using the functions HB_DeserialBegin() and HB_DeserialNext().

Info

See also:HB_Deserialize(), HB_DeserialBegin(), HB_Serialize(), HB_SerializeSimple()
Category: Serialization functions , xHarbour extensions
Source:rtl\hbsrlraw.c, rtl\hbserial.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates (de)serialization of a simple data type

   PROCEDURE Main
      LOCAL cBinary, cSerial, xValue

      cBinary := HB_SerializeSimple( Date() )

      xValue  := HB_DeserializeSimple( @cBinary )

      ? ValToPrg( xValue )

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe