permanent
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, or begins with any character except a letter or underscore, 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.

Permanent values can be used with shared databases, but they aren’t shared. Each local copy of the database has its own private copy of the permanent variables. If a user changes the value of a permanent variable, that is not shared with other users of the same shared database. There is no way that one user can find out what another user’s permanent variables contain, but there is a way to change what values are stored in another user’s permanent variables. An administator can upload a New Generation of the Database including the permanent variables. This will replace the permanent variables on other users' copy of the database the next time they open it. For another option for sharing this type of information, consider using a server variable, which is stored on the server and shared with other users of the shared database. See Server Variables (Shared Variables) to learn more about these variables.

See Also

- assign( -- assigns a value to a field or variable, also returning the value.
- assignglobal( -- assigns a value to a global variable (creating the variable if necessary).
- cache( -- stores a value in a temporary variable.
- callerslocalvariablevalue( -- allows a subroutine to access a local variable in the procedure that called it.
- cardvalidate -- verifies that a number is a valid credit card number.
- convertvariablestoconstants -- converts all of the variables in a formula into constant values.
- datatype( -- determines what kind of data is in a field or variable: text, number, etc.
- datavalue( -- returns the value of a field or variable: text, number, etc.
- fieldstotextvariables -- copies database fields into variables.
- fileglobal -- creates one or more fileglobal variables.
- fileglobalvalue( -- accesses a fileglobal or permanent variable from other databases.
- global -- creates one or more global variables.
- globalvalue( -- returns the value of a global variable.
- increment -- increments a field or variable.
- info("callerslocalvariables") -- returns a list of local variables defined in the procedure that called the current procedure.
- info("filevariables") -- builds a carriage return separated text array containing a list of the currently allocated fileglobal variables in the current database.
- info("globalvariables") -- builds a carriage return separated text array containing a list of the currently allocated global variables.
- info("localvariables") -- builds a carriage return separated text array containing a list of the currently allocated local variables.
- labelize( -- returns the value of a field or variable along with a label. This saves typing when you need to display fields or variables when logging and debugging.
- labelizeformula( -- returns the value of a formula along with the formula itself as a label.
- labelizeinfo( -- returns the value of an info( function, along with the function itself as a label.
- local -- creates one or more local variables.
- localparameters -- creates one or more local variables and assigns parameter values to them.
- localvalue( -- returns the value of a local variable.
- makefileglobals -- creates one or more fileglobal variables, and assigns a value to each new variable.
- makeglobals -- creates one or more global variables, and assigns a value to each new variable.
- makelocals -- creates one or more local variables, and assigns a value to each new variable.
- savelocalvariables -- saves local variables as a procedure.
- scopes( -- returns the current scope of a variable, as well as any hidden scopes.
- scopevalue( -- returns the value of a variable in the specified scope.
- setcallerslocal -- allows a subroutine to modify a local variable in the procedure that called it.
- setfileglobal -- sets the value of a fileglobal variable (optionally in another database).
- setfilevariable -- sets the value of a fileglobal variable in another database.
- setpermanentvariable -- sets the value of a permanent variable in another database. The database must be open. An empty value will choose the currently active database.
- setwindowglobal -- sets the value of a windowglobal variable (optionally in another window).
- showvariables -- forces Panorama to update the display of one or more variables on every form in the active database.
- showwindowvariables -- forces Panorama to update the display of one or more variables in the currently active form.
- tokenname( -- returns the name of a field or variable (instead of the value contained in the field or variables).
- undefine -- destroys one or more variables.
- undefinefileglobal -- destroys one or more fileglobal variables.
- undefineglobal -- destroys one or more global variables.
- undefinewindowglobal -- destroys one or more windowglobal variables.
- unpermanent -- converts one or more permanent variables into regular fileglobal variables. The variables will no longer be saved as part of the database.
- windowglobal -- creates one or more windowglobal variables.
- windowglobalvalue( -- accesses a windowglobal variable from other windows.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0