ZeroEffect
Junior Contributor
I know nothing of data structures so I am lost when it comes to even getting the code started. I do have the concept in mind of what I need to do.
1. Pass data to a buffer.
2. when the buffer becomes full dump the first in data
3. move all other data up
4. add new data to the end.
5. When data is needed from the buffer garb it from the end while it is still being written to the front.
So there is my understanding of the circular buffer concept .
I haven't really found an example I could understand what was being done.
This doesn't seem very efficient to me.
Thanks
ZeroEffect
1. Pass data to a buffer.
2. when the buffer becomes full dump the first in data
3. move all other data up
4. add new data to the end.
5. When data is needed from the buffer garb it from the end while it is still being written to the front.
So there is my understanding of the circular buffer concept .
I haven't really found an example I could understand what was being done.
Visual Basic:
Dim delayBuff(9) as string
Dim buffPos as integer = 0
Dim blnHasData as boolean = False
Private Sub CBuffer(strData as string)
Dim I as Integer
Dim J as Integer
Dim K as Integer
For I = 1 to 9
J = 10 - I
k = 9 - I
delayBuff(J) = delayBuff(K) 'Shift the buffer up one and remove the last bit of data
next
delayBuff(0) = strData
End Sub
This doesn't seem very efficient to me.
Thanks
ZeroEffect