Description

Returns the value of a variable at a given offset.

Syntax

val = GetBinaryValue(variable, offset, varType [, varSize]

Parameters

The function has the following parameters:

ParameterDescription
variableA binary structure to return data from.
offsetThe starting offset of the data to be extracted
varTypeThe type of data within the variable, i.e., CHAR, INT
varSizeAn optional parameter. This should be set the byte size of the data to be returned.

Returns

A binary value based on the offset, type and size.

See also

ANSI_Unicode()Unicode_ANSI()GetByteSize()

Example

/* This example takes the following steps:
1. Converts an ANSI string to UNICODE
2. Determines the length of the string
3. Extracts the first 10 characters from the string
4. Converts the UNICODE string to ANSI
*/
 
ansi_string = "Hello World"
* Convert the string to Unicode
unicode_string = ANSI_Unicode( ansi_string : \00\ )
uniLength = GetByteSize( unicode_string )
val = GetBinaryValue( unicode_string, 1, CHAR, 10 )
newString = Unicode_ANSI( val )
  • No labels