*MemoryBuffer

Just starting out? Need help? Post your questions and find answers here.
Quin
Addict
Addict
Posts: 1124
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: *MemoryBuffer

Post by Quin »

rndrei wrote: Fri Apr 25, 2025 11:16 am Thanks for the different options, but I have never found documentation about reading the right byte from the buffer!
We told you exactly where to look. Nevertheless, here's a direct link.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: *MemoryBuffer

Post by AZJIO »

You can add any even number to the pointer to access any byte. I'm at work and it's hard for me to give an example right now. I gave a link, if you use a pointer to allocated memory as a pointer to a string, then you can go through all the bytes. You just need to use "for" in order not to exceed the limit of the allocated memory.
User avatar
jacdelad
Addict
Addict
Posts: 1991
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: *MemoryBuffer

Post by jacdelad »

rndrei wrote: Fri Apr 25, 2025 11:16 am Thanks for the different options, but I have never found documentation about reading the right byte from the buffer!
And I drank cappuccino!
The help is segmented into logical portions like memory, gui elements, graphics, sound...
If you need one of them, have at least one look into the index and see which commands are available and what they do.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: *MemoryBuffer

Post by AZJIO »

rndrei wrote: Thu Apr 24, 2025 6:31 pm Tell me how to read the right byte from memory?
Here we are reading the 6th byte.

Code: Select all

*buffer = AllocateMemory(1000)
PokeS(*buffer, "regards")
Debug PeekB(*buffer + 6)
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: *MemoryBuffer

Post by #NULL »

AZJIO wrote: Fri Apr 25, 2025 5:04 pmHere we are reading the 6th byte.
+0 is the first byte, +6 is the 7th byte actually. :)
Post Reply