[futurebasic] BLOCKMOVE Does What Now???

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Richard Phillips <rpphillips@...>
Date: Sun, 31 Oct 1999 04:15:20 -0700
 
    I've got a question about the guts of BLOCKMOVE that I'm hoping someone
might be able to clear up for me.
 
    Obviously BLOCKMOVE works pretty well when you're moving a bunch of bytes
from here to way over there.  But what if I need to slide a given block of
bytes only a few positions forward or backward of their original address?  My
guess is that BLOCKMOVE moves one byte at a time starting at the passed
addresses, and incrementing one address position for each additional byte until
BLOCKMOVE has completed its task.
 
    If the above assumption is correct, what if I need (for example) to free up
three bytes at the head of a 1,000 byte handle (this handle has been allocated
to a size of a zillion bytes).  Normally I'd do this by sliding the current
(example) 1,000 bytes in the handle "back" by three bytes.  Using a BLOCKMOVE
for this purpose will work for the first three bytes, but after that it'll be
copying bytes that it has already moved (in other words, the data becomes corrupted).
 
    Is the following a good rule-of-thumb when using BLOCKMOVE???  If the total
number of bytes to move is greater than the the distance to move, first make a
copy of the original data and copy from that.

    Or does BLOCKMOVE work in some other way that means that the above
situation isn't a problem?
 
    Thanks!
 
    -Rick