FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Access the structure HB_ITEM Harbour
Posts: 817
Joined: Sun Jun 15, 2008 07:47 PM
Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 01:59 PM

Good for all.
See if someone can tell me how to access the internal structure of HB_ITEM Harbour (not xHarbour).
Specifically I want to access the address:
myItem->item.asString.length // NOTE, not the value but also the direction.

As an example:
myItem->item.asString.value;

I can access like this:
char MyPointer = myItem->item.asString.value;
or function:
char
MyPointer = hb_itemGetCPtr(myItem) // This is the preferred

But myItem->item.asString.length, how?
There functions that do the same as hb_itemGetCPtr(myIyem) but myItem->item.asString.length?

///////////////// Espa帽ol /////////////////////////

Buenas a todos.
A ver si alguien sabe decirme como acceder a la estructura interna de HB_ITEM en Harbour (no en xHarbour).

Concr茅tamente quiero acceder a la direcci贸n de:
myItem->item.asString.length // OJO, no al valor si no a la direcci贸n.

Como ejemplo:
myItem->item.asString.value;

puedo acceder as铆:
char * miPuntero = myItem->item.asString.value;
o con la funci贸n:
char * miPuntero = hb_itemGetCPtr( myItem ); // Esta es la aconsejable

Pero para myItem->item.asString.length, c贸mo?
Hay alguna funci贸n que haga lo mismo que hb_itemGetCPtr( myIyem ) pero para myItem->item.asString.length?


:D:mrgreen::(:shock::P:twisted::?::idea::arrow:

______________________________________________________________________________

Sevilla - Andaluc铆a
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 03:35 PM

You ca try
ULONG hb_arrayGetCLen( myItem )

Regards
Massimo

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 03:45 PM
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 04:17 PM

Sorry,

this is the function

ULONG hb_itemGetCLen( myItem )

Regards
Massimo

Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 04:46 PM
Example

Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()
聽 聽 聽 聽 LOCAL 聽 nLen
聽 聽 聽 聽 
聽 聽 聽 聽 nLen := MyTest( "Example" ) 聽 聽
聽 聽 聽 聽 
聽 聽 聽 聽 MsgStop( nLen ) 聽 聽
RETURN NIL


#pragma BEGINDUMP

#include "hbapi.h"
#include "hbapiitm.h"


HB_FUNC( MYTEST )
{
聽 聽 聽 聽 PHB_ITEM myItem = hb_itemNew(NULL) ;
聽 聽 聽 聽 ULONG nRet ;
聽 聽 聽 聽 const char *pStr = hb_parc(1) ;
聽 聽 聽 聽 
聽 聽 聽 聽 hb_itemPutC( myItem, pStr ) ;
聽 聽 聽 聽 
聽 聽 聽 聽 nRet = hb_itemGetCLen( myItem );
聽 聽 聽 聽 
聽 聽 聽 聽 hb_itemRelease( myItem );
聽 聽 聽 聽 
聽 聽 聽 聽 hb_retnl( nRet ) ;
}

#pragma ENDDUMP


Regards
Massimo
Posts: 817
Joined: Sun Jun 15, 2008 07:47 PM
Re: Access the structure HB_ITEM Harbour
Posted: Mon Nov 25, 2013 07:39 PM

Gracias Massimo.
Realmente lo que pasa es lo que dice Daniel.

Yo no quiero saber el ancho sino la direcci贸n del elemento que guarda...

////////////////////////

Thanks Massimo.
Actually what happens is what Daniel says.

I do not want to know the width but the direction of the element that keeps ... :cry:

______________________________________________________________________________

Sevilla - Andaluc铆a

Continue the discussion