User blog comment:Lumage/Saving as a package?/@comment-9531161-20130819204335

Saving as a package requires that you have the resources you'd like to save with the program already loaded. You would then remove the lines that load the resource in your program (since users will not have this file; it is part of the package). Finally, you save the program with a special "package" string that indicates which resources (that are currently loaded) should be saved with the program.

For instance, let's say you have a program called "MONKEYS", and you want to save your "SPU0:BANANAS" and your "BGU0:JUNGLE" with it. Remember, SPU0 and BGU0 are the first pages of their set. First, you'd load your MONKEYS program:

LOAD "MONKEYS"

Next, you'd load your resources:

LOAD "SPU0:BANANAS"

LOAD "BGU0:JUNGLE"

Then, you'd find the lines in your program which load these two sheets and delete them. Finally, you need to save your program with the special "package" string. This part requires that you understand a little bit about binary and hexadecimal. If you need help with that, please let me know. The package string is desribed on page 98 of the Petit Computer Manual. The package string for this program would be "00101", as we're saving the first page of the BGU and the first page of the SPU. Thus, we would save as a package with the command:

SAVE "MONKEYS", "00101"

Please note that if you save your MONKEYS program again after packaging and do not include the package string or do no preload the files before doing so, your program will become "depackaged" and your program may not work correctly.