Hi!
The code does not compile because it contains errors. What is the
purpose of these functions? I really could not understand it.
= (
[code]
FUNCTION Main
LOCAL pFunc := ( @Test() )
cls
? Valtype( pFunc )
? POINTER2STRING( pFunc )
?
RETURN NIL
function Test
? "hello word"
return NIL
#pragma begindump
#include "hbapi.h"
#include "hbapiitm.h"
HB_FUNC( STRING2POINTER )
{
PHB_ITEM s = hb_param( 1, HB_IT_STRING );
if( s )
hb_retptr( (void *) hb_itemGetCPtr( s ) );
}
HB_FUNC( POINTER2STRING )
{
PHB_ITEM p = hb_param( 1, HB_IT_POINTER );
if( p )
{
PHB_ITEM s = hb_itemNew( NULL );
PHB_ITEM n = hb_param( 2, HB_IT_NUMERIC );
hb_itemPutCL( s, hb_itemGetPtr( p ), n ? hb_itemGetNI( n ) : strlen(
hb_itemGetPtr( p ) ) );
hb_itemReturnRelease( s );
}
}
#pragma enddump
[/code]
Regards,
Vailton Renato
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour