Adr Function

Action

Retrieves the memory address of a variable or string constant. Therefore it acts like the “&” operator in C.

Include file

Kernel.bdh

Syntax

Adr( in sString : string ): number;

Return value

address of variable

Parameter Description
sString Variable or string constant

Example

dcltrans
  transaction TAdr
  var
    sString : string(10);
    nAddress : number;
  begin
    // nAddress receives the address of the string sString
    nAddress := Adr(sString);
    Memset(nAddress, 0, 10);
    write("address = "); write(nAddress); writeln;
  end TAdr;

Output

address = 8721488