GetMem8
从内存地址读取八个字节到Currency变量中。
语法:GetMem8 Address , retVal
- Address
- 必需 LongPtr。要读取的地址。
- retVal
- 必需 Currency。接收从Address读取的字节的变量。
Currency是这些原语使用的方便的八字节有符号整数载体,因为其内存表示;结果是存储在Address的原始64位模式,仅在算术运算时按Currency类型的固定因子10000进行缩放。要将位作为未缩放的64位整数处理,请使用LSet将Currency值转换为LongLong变量。
直接读取地址,不进行边界或对齐检查。
示例
本示例将一个8字节值写入缓冲区并用GetMem8读回。
vb
Dim buf As LongPtr = AllocMem(8)
Dim src As Currency = 1000000@
PutMem8 buf, src
Dim dst As Currency
GetMem8 buf, dst ' dst = src (same raw 8-byte pattern)
FreeMem buf