[futurebasic] Re: [FB] Blockmove

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

From: Rich Love <richlove@...>
Date: Mon, 31 May 2004 09:43:14 -0500
Yes, my program provides new values for the last row.
I used Robert's example and everything seems to be working fine.

It was also working fine with my old incorrect method. That is the 
scary thing about memory allocation. You can get away with it and then 
it comes back to haunt you later.

Rich Love - Carnation Software
MacWise Terminal emulation for Macintosh
512 858-9234

On May 31, 2004, at 7:55 AM, Jay Reeve wrote:

> 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@...

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