|
|
|
|
|
BufferToHexa (Function) In french: BufferVersHexa Converts a buffer into a displayable hexadecimal string (e.g. "4A 5B 00"). This function is mainly used to check the content of a buffer byte by byte. Note: To convert a hexadecimal string into a buffer, use the HexaToBuffer function..
s is Buffer = fChargeTexte(SAI_NomFichier)
SAI_Dump = BufferToHexa(s)
s is string Unicode = "abdcefghijkl"
Trace(BufferToHexa(s))
s is string Unicode = "Plétopabo"
Trace(BufferToHexa(s, 1))
Trace(BufferToHexa(s, 2))
Trace(BufferToHexa(s, 2, BigEndian))
Trace(BufferToHexa(s, 4))
Trace(BufferToHexa(s, 4, BigEndian))
Syntax
<Result> = BufferToHexa(<Buffer to convert> [, <Nb bytes per word> [, <Nb bytes per line>]])
<Result>: Character string Character string in hexadecimal format. <Buffer to convert>: Buffer Buffer to use. This parameter can also correspond to an ANSI or Unicode string. <Nb bytes per word>: Integer or Integer constant Number of bytes per word. This parameter can correspond to: - 1 (default): values are grouped by byte.
- 2: values are grouped in 2-byte words.
- 4: values are grouped by double word of 4 bytes.
- the constant NoGrouping: no grouping will be performed. All hexadecimal codes will have no spaces. Example: 61002345A1.
<Nb bytes per line>: Integer or Integer constant Number of bytes before moving to the next line. - After each <Nb bytes per line> a Carriage Return (CR) is added to the result string.
- If <Nb bytes per line> is less than <Nb bytes per word>, the Carriage Return (CR) will be added every <Nb bytes per word>.
- If this parameter corresponds to the NoLine constant, all bytes will be positioned on the same line.
By default: - this number is equal to 16.
- the grouping is performed using the Little-Endian method (the least significant byte is stored first, like in x86).
- if <Nb bytes per word> is set to NoGrouping, then <Nb bytes per line> will correspond to the NoLine constant by default.
To group values in Big-Endian format: - use the BigEndian constant.
- add the BigEndian constant to the value of <Nb bytes per line>.
- Note: the constant SansLigne can be combined with the constant BigEndian.
Remarks Creating an identifier The NoGrouping and NoLine constants are used to simplify the creation of an identifier from a buffer. Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|