I have variable:
data: TIdBytes;
it contains some amount of data.
How to read first byte of “data”, and delete the first byte from “data” ?
And yes, I will do it again and again. Until “data” will be empty.
I will use the copied byte with “IF”
if $0F = Copiedbyte then
do_somthing;
maybe deleting is not so necessary, I just can copy next byte..
I don’t need loop, i just need to copy one byte the do something with it, for example save for later use.
You don’t need to delete anything and it seems wasteful to do so. It would make your code messier and cost CPU time.
Just iterate over the array of bytes:
If you don’t want to do this in a loop, keep track of the index of the next byte to be processed. Every time you process a byte, increment the index.
Initialise an index variable to 0 and keep calling this function, extracting one byte at a time, until it returns False.