^ADDR

Obtain the address of a data element

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
address = ^ADDR(variable)

Return value

address

The address of the referenced data. (D_ADDR)

Arguments

variable

A variable whose address will be obtained. (a or n)

Discussion

Specify the data storage for address with D_ADDR to ensure the variable is large enough to contain the entire address value.

Examples

.include "$DVIDEF" library "DBLSTARLET"
external function
    sys$getdviw         ,^val
record
    stat                ,i4
    group itmlst        ,[2]i
      group lw1         ,i4
        len             ,i2
        code            ,i2
      endgroup
      bufaddr           ,D_ADDR
      retlen            ,D_ADDR
    endgroup
    tt_name             ,a16
proc
    open(1, o, "tt:")
    itmlst[1].len = ^size(tt_name)
    itmlst[1].code = DVI$_DEVNAM
    itmlst[1].bufaddr = ^addr(tt_name)
    clear itmlst[1].retlen, itmlst[2].lw1
    stat = %sys$getdviw(,, "TT:", ^ref(itmlst),,,,)
    if (.not. (stat .band. 1))
      xcall lib$stop(^val(stat))
; Get the device name of the terminal
    writes(1, tt_name)
end