permanent
VARIABLES

The permanent statement creates one or more permanent variables.


Parameters

This statement has one parameter:

variables – is a list of variables to be created. Each variable should be separated from the next by a comma. If a variable name contains spaces or punctuation it should be surrounded by chevron (« ») characters.


Description

This statement creates one or more permanent variables. Like fileglobal variables, permanent variables are associated with a particular database – in fact, permanent variables are fileglobal variables. Unlike regular fileglobal variables, however, permanent variables are permanently attached to the current database. Whenever that database is saved the permanent variables are saved along with it. When the database is opened these variables will be automatically re-created and filled with the previous data. Permanent variables are very useful for preferences, passwords, etc. Note: The dbinfo( function can create a list of the permanent variables associated with a database.

The example creates two permanent variables, SalesTaxRate and EarlyDiscount.

permanent SalesTaxRate, EarlyDiscount

Permanent variables may be used just like any other variable. You may change the value of the variable with an assignment, like this:

SalesTaxRate=0.075

When the database is saved, the SalesTaxRate will also be saved. Note: If you close the file without saving, the new SalesTaxRate value will not be saved!

A permanent variable is forever, unless you destroy it with the unpermanent statement. Once you’ve created the permanent variable, it will remain forever attached to the database, even if you never run the procedure containing the permanent statement again – or even if you delete that procedure! On the other hand, there’s no harm in running the permanent statement twice for the same variable, it will simply continue to use the already created permanent variable.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0