Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - ptrtoulong() read a ulong value from a memory address http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ptrtoulong()        Read a ulong value from a memory address
------------------------------------------------------------------------------
 Declaration
   memory.hdr

 Syntax
   func ulong ptrtoulong extern
   param value _POINTER pMem

 Arguments
   pMem is a memory address.

 Return
   A ulong value.

 Description
   This function returns the ulong located at the specified memory address.

   The function is included for compatibility with earlier Force versions.
   Use the ptr() data type in conjunction with the & and * operators for
   directly writing to explicit memory addresses.

 Example
   #define EXAMPLE_MEMORY
   #include example.hdr

   proc Test_ptrtoulong
   vardef
      ulong        nVar
      ptr( ulong ) pMem
   enddef
   nVar := 12345678
   ? nVar                        // access ulong variable directly
   ? ptrtoulong( addr( nVar ) )  // access ulong variable using function calls
   pMem := &nVar                 // access ulong variable using pointer
   ? *pMem
   endproc

   proc main
   Test_ptrtoulong()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson