GetUChar Function

Action

Retrieves a one-byte unsigned character from a specified data structure at a specified position. You must declare a BDL string before using this function.

Include file

Kernel.bdh

Syntax

GetUChar( in sBuffer : string,
          in nPos    : number ): number;

Return value

unsigned character

Parameter Description
sBuffer BDL string corresponding to the data structure
nPos Starting position in the BDL string, where the first position is 1 (not 0)

Example

dcltrans
  transaction TGetUChar
  const
    SIZE_STRUCT := 32;
  var    myBDLstring : string(SIZE_STRUCT);
    nChar : number;
  begin
    ...
    // Retrieve a one-byte unsigned character from position 32
    // in the BDL string myBDLstring and thereby (through mapping) get
    // the element myUChar in Struct1
    nChar := GetUChar(myBDLstring, 32);
    write("myUChar = "); write(nChar); writeln;
  end TGetUChar;

Output

myUChar = 22