In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

HexToString() problem

Xailer professional forum in English
Responder
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

HexToString() problem

Mensaje por Ingo JH »

Hi,
I have a understandig problem:
Hex( 243184193 ) returns the string "E7EB241" - this is correct
HexToDec(Hex( 243184193 )) returns the numeric value 243184193 - this is
correct too
but why
HexToString(HEX(243184193)) doesn't return the string "243184193"?
The Xailer-documentation says:
"Converts an hexadecimal format number (saved in a string) to decimal format
as a string."
Is this a bug in the function or in my brain?
Regards
Ingo
xAvi
Mensajes: 108
Registrado: Mar Abr 08, 2008 6:12 pm

HexToString() problem

Mensaje por xAvi »

Hi Ingo,
Ingo escribió:
> The Xailer-documentation says:
> "Converts an hexadecimal format number (saved in a string) to decimal
> format as a string."
>
The help is some confuse, I understand for buffer conversion.-
Local cH2S, cS2H, cbMemBuffer
cbMemBuffer := Chr(15) + Chr(15)
LogDebug( Asc( cbMemBuffer[1] ), Asc( cbMemBuffer[2] ) ) // 15 15
cS2H := StringToHex( cbMemBuffer )
LogDebug( cS2H ) // 0F0F See that it is with format "%02X" for each char
cH2S := HexToString( cS2H ) // 15 15 See that take out format
LogDebug( Asc( cH2S[1] ), Asc( cH2S[2] ) )
// And for numeric/string conversion
LogDebug( Hex( 255 ) ) // ff
LogDebug( HexToDec( 'FF' ) ) // 255
Best regards
Xavi
xAvi
Mensajes: 108
Registrado: Mar Abr 08, 2008 6:12 pm

HexToString() problem

Mensaje por xAvi »

Hi Ingo,
Ingo escribió:
> The Xailer-documentation says:
> "Converts an hexadecimal format number (saved in a string) to decimal
> format as a string."
>
The help is some confuse, I understand for buffer conversion.-
Local cH2S, cS2H, cbMemBuffer
cbMemBuffer := Chr(15) + Chr(15)
LogDebug( Asc( cbMemBuffer[1] ), Asc( cbMemBuffer[2] ) ) // 15 15
cS2H := StringToHex( cbMemBuffer )
LogDebug( cS2H ) // 0F0F See that it is with format "%02X" for each char
cH2S := HexToString( cS2H ) // 15 15 See that take out format
LogDebug( Asc( cH2S[1] ), Asc( cH2S[2] ) )
// And for numeric/string conversion
LogDebug( Hex( 255 ) ) // ff
LogDebug( HexToDec( 'FF' ) ) // 255
Best regards
Xavi
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

HexToString() problem

Mensaje por Ingo JH »

Xavi,
yes I see I misunderstood the help totally.
Thank you very much
Ingo
"xAvi" <jarabal_eliminar_no_spam_@gmail.com> schrieb im Newsbeitrag
news:4791edbd$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi Ingo,
>
> Ingo escribió:
>> The Xailer-documentation says:
>> "Converts an hexadecimal format number (saved in a string) to decimal
>> format as a string."
>>
>
> The help is some confuse, I understand for buffer conversion.-
>
> Local cH2S, cS2H, cbMemBuffer
>
> cbMemBuffer := Chr(15) + Chr(15)
> LogDebug( Asc( cbMemBuffer[1] ), Asc( cbMemBuffer[2] ) ) // 15 15
>
> cS2H := StringToHex( cbMemBuffer )
> LogDebug( cS2H ) // 0F0F See that it is with format "%02X" for each char
>
> cH2S := HexToString( cS2H ) // 15 15 See that take out format
> LogDebug( Asc( cH2S[1] ), Asc( cH2S[2] ) )
>
> // And for numeric/string conversion
> LogDebug( Hex( 255 ) ) // ff
> LogDebug( HexToDec( 'FF' ) ) // 255
>
> Best regards
> Xavi
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

HexToString() problem

Mensaje por Ingo JH »

Xavi,
yes I see I misunderstood the help totally.
Thank you very much
Ingo
"xAvi" <jarabal_eliminar_no_spam_@gmail.com> schrieb im Newsbeitrag
news:4791edbd$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi Ingo,
>
> Ingo escribió:
>> The Xailer-documentation says:
>> "Converts an hexadecimal format number (saved in a string) to decimal
>> format as a string."
>>
>
> The help is some confuse, I understand for buffer conversion.-
>
> Local cH2S, cS2H, cbMemBuffer
>
> cbMemBuffer := Chr(15) + Chr(15)
> LogDebug( Asc( cbMemBuffer[1] ), Asc( cbMemBuffer[2] ) ) // 15 15
>
> cS2H := StringToHex( cbMemBuffer )
> LogDebug( cS2H ) // 0F0F See that it is with format "%02X" for each char
>
> cH2S := HexToString( cS2H ) // 15 15 See that take out format
> LogDebug( Asc( cH2S[1] ), Asc( cH2S[2] ) )
>
> // And for numeric/string conversion
> LogDebug( Hex( 255 ) ) // ff
> LogDebug( HexToDec( 'FF' ) ) // 255
>
> Best regards
> Xavi
Responder