Hi,
I need to convert a block of code ({||}) to a string. How can I do this?
I need to convert a block of code ({||}) to a string. How can I do this?
 b := { || MsgInfo( "Good" ) }
  Eval( b )
  c := HB_Serialize( b )
  ? ValType( c ), Len( c ), STRTOHEX( c )
  // save the string as hex and restore
  b := HB_DeSerialize( c )
  ? Eval( b )Thanks !
ValToPrg() and ValToPrgExp() are not useful for Objects and Codeblocks.
Dear Rao,
Just out of curiosity, I haven't really delved into the question yet. But would JSON encode and decode also be an option?
Best regards,
Otto
Otto wrote:Dear Rao,Even to encode into Json, we first need to convert the codeblock into a "text" string.
Just out of curiosity, I haven't really delved into the question yet. But would JSON encode and decode also be an option?
Best regards,
Otto
I used cMimeEnc() instead of strtohex()