Options:
D -Decrypt the Catalog
E -Encrypt the Catalog
X -Suppress the command response
Y -Do not alter the command answer cells
Answers:
Ctl.Ans1 =The number of definitions in the Catalog
Ctl.Ans2 =The size if the Catalog in bytes
Ctl.Ans3 =Zero
Notes:
PACK may not be used from a procedure or menu, it is a "DCL only" type of command.
As the Catalog packs, any holes in the file space are released, causing the size of the Catalog to shrink.
PACK with no arguments packs the Application Catalog (the .PRS file).
PACK with the H argument packs the Help Catalog (the .HHH file).
PACK renames the old Catalog xxx.OLD (where xxx is the AI name) in case something goes wrong and you need to revert back to the catalog as it existed before packing. To revert, just rename xxx.OLD back to xxx.PRS.
For Help Catalogs, the old version is renamed xxx.OHH (where xxx is your Help file name). To revert, just rename xxx.OHH back to xxx.HHH.
Encrypting Catalogs
One day one of our VARs called in and said "O.K., I have the RunTime version and I know that I can deliver my applications with it, and that the RunTime version does not let the user get at my code in order to copy or modify it. What is to prevent the user from buying the Developers version from you, installing it, and then gain access to my code?
The answer then was "Nothing." Now there is a better answer.
You can encrypt your Catalog so that other people will have no access to it, but it will look normal to you (or to anyone else who has your encryption key). Even the Developers version will act like a RunTime version when it encounters an encrypted Catalog and the encryption key was not provided in the current session.
The technique to encrypt your Catalog is as follows:
1. Use the MODE ENCRYPT
command to establish your encryption key.
2. Do a PACK/E to encrypt your Catalog.
The technique to put an encrypted Catalog back to normal is:
1. Use MODE ENCRYPT to establish the encryption key.
2. Do a PACK/D to decrypt the Catalog
DO NOT FORGET THE ENCRYPTION KEY. No one can help you if you do.
Once you have done the PACK/E you won't notice any difference as long as you are in the same session that established the encryption key and did the PACK/E. But once you get out and come back in, you will notice that there is no access to your Catalog until you use the MODE command to re-establish the encryption key. The MODE command syntax is:
MODE ENCRYPT encryption-key
You do not have to decrypt the Catalog in order to work with it. Just use the MODE command to re-establish the key for this session.
You may want to create a CONFIG
file that contains the correct MODE command, then you won't have to keep resupplying the key with every session. Just don't ship that CONFIG file with your application. Because of the danger of overlooking this last detail, this author prefers to not use the CONFIG file, and thus resupplies the key with every session. You get used to it.