The undefineservervariable statement destroys a server variable.


This statement has two parameters:

database – name of the database. This must be a shared database that is currently open. If this parameter is omitted or is empty, the current database is assumed.

variable – name of the variable. The variable can be specified directly (not quoted), or with a formula.


This statement destroys a permanent variable on the server. The variable must belong to a shared database (usually the current database, but any open shared database can be specified).

This example destroys the server variable defaultAreaCode. (Keep in mind that this destroys this variable for ALL users of this shared database, not just on the local computer. So use this statement with care.)

undefineservervariable defaultAreaCode

If the variable name contains spaces or other punctuation, you must surround the variable name with chevrons (Option-\ and Shift-Option-\), like this:

undefineservervariable «Default Area Code»

Normally the variable name is “hard coded” into the code as shown in the examples above, but you can calculate the variable name with a formula. This example will destroy a different variable depending on the day of the week – MondayClose, TuesdayClose, WednesdayClose, etc.

undefineservervariable datepattern( today(),"DayOfWeek")+"Close"

The undefineservervariable statement normally destroys a server variable belonging to the current database, but you can specify a different database if you want. The specified database must be a shared database, and it must be currently open. Here is a revised version of the previous example that destroys the server defaultAreaCode variable in the Contacts database instead of the current database.

undefineservervariable "Contacts",defaultAreaCode

See Also


10.2NewNew in this version.