NumGet()

Auto Hotkey

NumGet

Returns the binary number stored at the specified address+offset.

OutputVar := NumGet(VarOrAddress , Offset = 0, Type = UPtr)
Function Example: val := NumGet(MyVar,"UInt") 

Parameters

OutputVar

The name of the variable in which to store the number at the specified address+offset.

If the target address is invalid, an empty string is returned. However, some invalid addresses cannot be detected as such and may cause unpredictable behaviour.

VarOrAddress

A memory address or variable. If VarOrAddress is a variable such as MyVar and it contains a string (not a pure number), the address of the variable's string buffer is used. This is usually equivalent to passing &MyVar, but omitting the "&" performs better and ensures that the target address + offset is valid. If the variable contains a pure number, that number is assumed to be an address.

Offset

An offset - in bytes - which is added to VarOrAddress to determine the target address.

Type

One of the following strings (defaults to UPtr if omitted):
UInt, Int, Int64, Short, UShort, Char, UChar, Double, Float, Ptr or UPtr

Unlike DllCall, these must be enclosed in quotes when used as literal strings.

For details see DllCall Types.

General Remarks

If only two parameters are present, the second parameter can be either Offset or Type. For example, NumGet(var, "int") is valid.

Related

NumPut, DllCall, VarSetCapacity