Peek/Poke alternatives

Everything else that doesn't fall into one of the other PB categories.
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Perhaps if I take my time and comment it

Code: Select all

; OK, here we go. Defining a simple Long Variable called a.
a.l = 23

; Now we define a Pointer called *ptr of the Type LONG
; We also assign it the Memory Adress of the Variable a, thus *ptr pointing to a now
*ptr.LONG = @a

; As the Type LONG is indeed a Structure, we can access the content through
; the member l, using the simple Syntax  structureVariable\Member.
; The only Member in LONG is the Long Value l
*ptr\l = 42

; Because *ptr pointed to a, we changed the content of a. It should now read 42
Debug a
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Of course, commented code show better :) Now I have understood your code, thanks a lot !
Memory is not easy sometimes :?
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

You'll get used to it the more often you use it :D
Post Reply