SAVEP Verb - BBj


For this topic's original documentation, see SAVE Verb - Save File.

BBj-Specific Information (BBj 6.0 and higher only)

Syntax

SAVEP{filename}{,password}{,create}

Description

SAVEP protects the program contents. A program with protected status is not listable. Using a password argument with the CLEARP verb allows restoration of the program to a listable state with the CLEARP verb.

Parameter

Description

filename(string)

Specifies the saved filename. An unspecified filename defaults to the current filename.

password(string)

A password that provides the ability to clear the protected status of a program by use of the CLEARP verb. An empty string ($$) explicitly indicates the unclearable password. Omitting the password argument leaves a previously protected program's password unchanged. Omitting the password argument for an unprotected program implies the unclearable password.

create(int)

Specifies that the file does not exist and BBj should create the file.

Remarks

A program saved without a password (including those saved with SAVEP before BBj 6.0) has what is known as an "unclearable" password and is not restorable to a listable state.

SAVEP will not change the password of a protected program. Attempting to change the password of a program with protected status will result in an error.

NOTE: In BBj 18.0 and higher, the SAVEP format has been updated for improved security.  The new SAVEP format is not backwards compatible with older versions of BBj and Pro5.

In order to enable a smooth transition, in BBj 18.20 and above, BBj can SAVEP programs using the previous SAVEP format by setting an STBL:

A$=STBL("!USE_PREVIOUS_BBJ_SAVEP_FORMAT","true")

This will tell BBj to SAVEP using the previous SAVEP format as well as SAVE programs already using the previous SAVEP format without converting them to the current SAVEP format. For security, programs already in the current SAVEP format cannot be converted to the previous format.

This is intended to be a temporary measure, since previous SAVEP formats will always be less secure due to the fact that the SAVEP format only changes in order to improve security.

Although a program can be saved using the previous SAVEP format, it may not run correctly in a previous version of BBj. Different versions of BBj have both major and minor changes in functionality that might prevent a program from running correctly even if a previous version is able to load it.

Example

REM ' SAVEP with the unclearable password.
SAVEP "program.bbj", 0
SAVEP "program.bbj", $$, 0
SAVEP "program.bbj"

REM ' SAVEP with the password "password"
SAVEP "program.bbj", "password", 0
SAVEP "program.bbj", "password"
SAVEP

REM ' Causes an !ERROR 18, different password.
> SAVEP "program.bbj", "helloworld", 0
> SAVEP "program.bbj", "goodbye", 0
!ERR=18 (Different password specified on SAVEP of protected program)

REM ' Cannot change the unclearable password
> SAVEP "program.bbj", 0
> SAVEP "program.bbj", "goodbye", 0
!ERR=18 (Different password specified on SAVEP of protected program)