[Coco] String Packing

Arthur Flexser flexser at fiu.edu
Wed Jan 24 22:07:47 EST 2018


And once you've run that program, which should have a statement like WW$="
                    ", with the number of blanks inside the quotes equaling
the length of the string, you can resave the program and delete the lines
involving VARPTR and poking the data in, because the data in the string is
now part of the program, as can be verified by listing the program.  (Or,
if you don't enjoy counting blanks, the value of VARPTR(WW$) will contain
the string length (number of blanks between the quotes), and you can
replace that number with the desired one by poking the desired number into
VARPTR(WW$) prior to poking the data into the string.  Just make sure
you've allowed at least enough blanks between the quotes to accommodate the
string, or the string data will overwrite the next line of your program.)

(I'm assuming, and I'm PRETTY sure this is right, that characters within
quotes can have any Ascii value without being filtered out in loading the
program or causing other strangeness.  Though the listing of the string may
look different than expected because LIST does filter out some characters.)

Art

On Wed, Jan 24, 2018 at 9:27 PM, tim franklinlabs.com <tim at franklinlabs.com>
wrote:

>    Yeah, that's it... But you had to do it command line... not programmed,
>    right. And you were  limited to 256 characters per pack because basic
>    limits a string length.
>    Cool, thanks.
>
>      On January 24, 2018 at 8:21 PM "D. Bruce Moore" wrote:
>
>      V=PEEK(VARPTR(WW$)+2)*256+PEEK(VARPTR(WW$)+3)
>
>      this is the start of the string. poke whatever you want into it!
>
>      On Jan 24, 2018, at 8:05 PM, tim franklinlabs.com wrote:
>      Years ago, I remember using a method in basic to pack a string with
>      extended data such as extended ASCII and binary programs. The data
>      was
>      stored in a string and saved with the program. When the program was
>      loaded, the data was already packed and there was no need to pull it
>      out of a data line.
>      Does anyone remember this technique? And remember how to do it?
>      Just curious... I'm old and can't remember hoe it was done.
>      --
>      Coco mailing list
>      [1]Coco at maltedmedia.com
>      [2]https://pairlist5.pair.net/mailman/listinfo/coco
>
>      --
>      Coco mailing list
>      [3]Coco at maltedmedia.com
>      [4]https://pairlist5.pair.net/mailman/listinfo/coco
>
> References
>
>    1. mailto:Coco at maltedmedia.com
>    2. https://pairlist5.pair.net/mailman/listinfo/coco
>    3. mailto:Coco at maltedmedia.com
>    4. https://pairlist5.pair.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list