[Coco] Programming help needed

Dave Philipsen dave at davebiz.com
Sun Dec 2 01:16:59 EST 2018


Another thing I was thinking of is to convert the binary data to hex (HEX$) and then save it as an ASCII string.  It would double the amount of space needed in your file but it would work. If DECB limits string length to 256 bytes then you may have to save it in two strings.

Dave

> On Dec 1, 2018, at 6:59 PM, Paul Shoemaker <paulfe3 at swbell.net> wrote:
> 
> Need some advice. I am trying to store to a disk file a 48x40 section from a PMODE 4 screen. 
> The method I am attempting to use is to peek the byte values using a nested loop and save them as a string. For example, A$ = A$ + CHR$ (PEEK(&HE00+X+(Y*32))). Note I am storing the byte value as a CHR$ because doing so makes the completed string length only 240 bytes long. Creating the string is working fine; I have validated that. 
> Saving the string to a disk file is not working, however. When I execute a WRITE #1,A$ followed by a PUT #1,<record #>, Disk BASIC is not saving entire contents of A$. I believe it is parsing the string as it goes or something, as it seems to be ignoring or even stopping on some "special" CHR$ codes.. like CHR$(0). 
> Is there a way around this?
> Thanks!
> -Paul
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list