[futurebasic] Re: Prblms rolling my own buffer

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1998 : Group Archive : Group : All Groups

From: Peter Bancroft <pbancroft@...>
Date: Wed, 5 Aug 1998 09:59:01 +1000
>Off top of my head I would just slide everything to the left, then drop
>the new character into the last slot.
>I'm assuming a fixed length buffer.  You could shift each character
>individually but it would get increasingly slow as the buffer gets
>larger.  I believe I have the syntax correct  BLOCKMOVE  sourcePtr&,
>destPtr&, lengthToMove.

Nah.
Create an array of a suitable size to be used as the buffer.
Create a pointer into the buffer.
Increment or decrement the pointer to read the characters.
When you get to the end of the array roll over to the beginning of the
array again.

Peter		mailto:peter@...		http://www.isoma.com