ADDRESS (return memory address)

Top  Previous  Next

 

ADDRESS(| variable | )

ADDRESS

Returns memory address of a variable.

variable

The label of a data item or PROCEDURE.

The ADDRESS procedure returns the address of the specified data item or PROCEDURE.

The ADDRESS procedure allows you to pass the address of a variable or procedure to external libraries written in other languages, or to reference assign the address to a reference variable.

Return Data Type:

LONG

Example:

MAP

 ClarionProc                     !A Clarion language procedure

 MODULE('External.Obj')          !An external library

  ExternVarProc(LONG)            !C procedure receiving variable address

  ExternProc(LONG)               !C procedure receiving procedure address

 END

END

 

Var1 CSTRING(10)                  !Define a null-terminated string

CODE

ExternVarProc(ADDRESS(Var1))     !Pass address of Var1 to external procedure

ExternProc(ADDRESS(ClarionProc)) !Pass address of ClarionProc

ClarionProc PROCEDURE             !A Clarion language procedure

CODE

RETURN

 

See Also:

PEEK

POKE

Reference Assignment Statements