transfer var type Hexadecimal

Post Reply
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

transfer var type Hexadecimal

Post by goosfancito »

Hello all,

I need make one function in FWH that transfer one data of type Hexadecimal to one function in xHarbour,

I traid it:

Code: Select all | Expand

HB_FUNC ( COMANDOCEM ){
   char *mensaje = hb_parcx( 01 );


then... COMANDOCEM("65")

My question is: "65" when i send to function COMANDOCEM is type string?
what i do to send "65" like Hexadecimal?
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
Antonio Linares
Site Admin
Posts: 42553
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 80 times
Contact:

Post by Antonio Linares »

Comandocem( nHex( cHex ) )

and from Comandocem():

LONG lValue = hb_parnl( 1 );
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

Post by goosfancito »

Antonio,

Entonces: hb_parnl( 1 ) devuelve un valor de tipo LONG?

Seria entonces que un Hexadecimal se lo puede almacenar en un dato de tipo LONG?


Como ser:

ComandoCEm(nhex( 101 ) )

...
Al hacer esto:
LONG lValue = hb_parnl( 1 );

lValue guardaria el 65 ( que es el valor hexadecimal del decimal 101 )

Es asi?
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
Antonio Linares
Site Admin
Posts: 42553
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 80 times
Contact:

Post by Antonio Linares »

Gustavo,

ComandoCEm( nhex( "101" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply