PokeWord
PokeWord Address, WordValue
 
Parameters:

    Address = The Address in memory where this data should be stored
    WordValue = The data you wish to store
Returns: NONE
 

      The PokeWord command will write a 16bit word value directly into memory.

      16Bit Values range between 0 and 65535



FACTS:


      * You can poke any memory location.

      * Care must be taken when writing/reading directly from memory. Attempting to access memory that is not part of your program will most likely cause your program to crash.

      * Also See Pointer




Mini Tutorial:


      This example creates a bank, grabs this banks memory address (the address f the first byte in memory), pokes various test values and strings into memory, then finally reads them back.

  
  
; Create Bank #1 and allocate 100 bytes of system memory for it
  CreateBank 1,100
  
; Grab the actual address (the pointer) of this banks memory.
  Address=GetBankPtr(1)
  
; Once you have the address of something in memory, you can now
; directly read/write information in it.
  
; While this gives the user great freedom, it also means you can
; crash your program if your not careful.
  
  
; Poke the 8bit byte value 255 into memory
  PokeByte Address,255
  
; Poke the 16bit Word value 64000 into memory
  PokeWord Address+1,64000
  
; Poke the 32bit INteger value $aabbccdd into memory
  PokeInt Address+3,$aabbccdd
  
; Poke the 32bit Floating Point value 123.456 into memory
  PokeFloat Address+7123.456
  
  
; Poke the a null terminated string "Hello World" into memory
  PokeString Address+12"Hello World",0
  
  
  
; Peek and display our byte from memory
  Print PeekByte(Address)
  
; Peek and display our word from memory
  Print PeekWord(Address+1)
  
; Peek and display our Integer value from memory
  Print Hex$(PeekInt(Address+3))
  
; Peek and display our Floating Point value from memory
  Print PeekFloat(Address+7)
  
; Peek and display our null terminated string from memory
  Print PeekString(Address+12,0)
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  




This example would output.

  
  255
  64000
  $aabbccdd
  123.456
  Hellow World
  

 
Related Info: PeekByte | PeekFloat | PeekInt | PeekString | PeekWord | PokeByte | PokeFloat | PokeInt | PokeString :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com