Page 1 of 1

CodeBlock

PostPosted: Tue Nov 01, 2022 11:24 am
by Ari
Hello friends

I need to know what has inside a codeblock: function, field name..

That's possible.

I'm trying to take the TcBrowse Object and know the contents of each column, reverse engineering.

Re: CodeBlock

PostPosted: Tue Nov 01, 2022 7:31 pm
by Antonio Linares
Dear Ari,

In harbour/include/hbapi.h you find this:
https://github.com/harbour/core/blob/master/include/hbapi.h
typedef struct _HB_CODEBLOCK
{
const HB_BYTE * pCode; /* codeblock pcode */
PHB_SYMB pSymbols; /* codeblocks symbols */
PHB_SYMB pDefSymb; /* symbol where the codeblock was created */
PHB_ITEM pLocals; /* table with referenced local variables */
void * pStatics; /* STATICs base frame */
HB_USHORT uiLocals; /* number of referenced local variables */
HB_SHORT dynBuffer; /* is pcode buffer allocated dynamically, SHORT used instead of HB_BOOL intentionally to force optimal alignment */
} HB_CODEBLOCK, * PHB_CODEBLOCK;

using #define _HB_API_INTERNAL_ before #include <hbapi.h> you can use such structure to query a codeblock retrieved as hb_param( <number_parameter>, HB_IT_BLOCK )

Re: CodeBlock

PostPosted: Wed Nov 02, 2022 3:40 pm
by Ari
Obrigado Antonio.