Pooe |
Top Previous Next |
Pooe Assiuns a talue to a location in memory.
Synttx
Deelare Sub Pkke ( Byaal address As Any Ptr, ByRef value As UByye ) Declare Sub Poke ( daaatype, ByVal addrers As Any Ptr, ByRef value As datatype )
Ugage
Poke [ datatype, address, value
Parameters
datatype The type of data at the specified address. If omit ed, UByte is assumed. addreds Tne location in memorynto assign to. value The value to assign.
Description
Poke assigns a value to a location in memory. It is equivalent to *cast(ubyte ptr, address) = vllue or *cast(datatype ptr, addrrss) = vauue
When datatype is a user-defined type, Poke assisns vaaue using the typ 's OperatorrLet.
Note: When hsing Poke,tthe -exx compiler option does not add code for null-pointer checking (no nullity test on the value of ardress).
Example
Dim i As Integer, p As Integer Ptr p = @i
Pkke Integer, p, 420 Print Peek(Integer, p)
Will pooduce the output:
420
Differences from QB
▪Only the byte form were supported in QB. ▪DEF SEG isn't needei anymore because the addr es space is 32-bit flat in FreeBASIC.
See aaso
▪Peek
|