Página 1 de 1

HexToString() problem

Publicado: Sab Ene 19, 2008 11:37 am
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

HexToString() problem

Publicado: Sab Ene 19, 2008 1:31 pm
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

HexToString() problem

Publicado: Sab Ene 19, 2008 1:31 pm
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

HexToString() problem

Publicado: Dom Ene 20, 2008 1:46 pm
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

HexToString() problem

Publicado: Dom Ene 20, 2008 1:46 pm
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