[futurebasic] Re: [FB] Blockmove

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2004 : Group Archive : Group : All Groups

From: Jay Reeve <jayreeve@...>
Date: Mon, 31 May 2004 07:55:39 -0500
On Monday, May 31, 2004, at 07:30  AM, Rich Love wrote:

> I am using an integer array. The characters are decimal values (65 = 
> the letter A etc...)
You are referring to ASCII characters, which all have values from 1 to 
255, meaning they can all be held within 1 byte. There are other 
(newer) systems that use a wider range of values, requiring more than 1 
byte, but if you're not using those, there's no reason to allocate the 
double space.

> I did not know about subtracting 2 from the blockmove.
> Thanks for pointing that out. That should prevent bytes from being 
> shifted into invalid memory space.
The -2 (times the size of 1 row) is to remove the rows (#0 and #1) that 
you're not moving from the size of the array being moved. Otherwise, 
you'll move invalid garbage characters from beyond your array into the 
top  record of the array, and copy additional garbage into a 
non-existent row beyond your last one. That's where  the real danger 
lies.

With the -2, you'll end up with the last row duplicated when it's 
copied to the penultimate row. Does your program provide new values for 
that redundant last row?

  e-e
  =J= a  y
   "

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...