DEFAULT |
Default is used to define the search priority for variables in the various classes of variables (files, masks), the general search priority for a given variable without a class, or the default creation class for Adonix variables.
Default is also used in the syntax of a Case alternative (When Default). See Case for this syntax.
Default Mask class | list_classes
Default File class | list_classes
Default list_classes
Default class
Default Local
Default Global
|
Element |
Description |
Restrictions |
|
list_classes |
List of classes separated by the character ','. |
None. |
|
class |
Indicates a mask key word in the Default Mask syntax, or a file key word in the Default File syntax. |
The classes must be accessible. |
# Only the following classes are accessible for a variable# whose class is not specified, and in the order given
Default [S], [L], [V], [C], [M:XY]
# By default, variables without class are searched for in class [L]Default [L]
# By default, non-existent variables are created in class [L]Default Local
# Using the above order, variable I is created in class [L] # with type Decimal if it did not exist previouslyFor I = 1 To 100 : Infbox num$(I) : Next I
# [CLI] shall be used by default for any mask variable # and the default file shall be [PROD] Default Mask [CLI]Default File [PROD]
# By default, variables should preferably be sought in # masks (in the sequence [CLI],[PRO],[REP], followed by other # masks), then in classes [L] and {C] only. Default Mask [REP] Default Mask [PRO] Default Mask [CLI] Default [M], [L], [C] # The default classes should preferably be first [C], then [L], # then [V], then the other classes in the usual sequence.Default [V] : Default [L] : Default [C]
# By default, variables should preferably be sought # in the list of masks (in the order [CLI],[PRO],[REP]) Default Mask "[CLI],[PRO],[REP]" # By default, variables should preferably be sought # in the list of files (in the order [FI1],[FI2],[FI3]) Default File "[FI1],[FI2],[FI3]" # Variables shall be sought in the files, then in the # masks), then in classes [V] and [S] only. Masks # are accessible in the sequence [CLI],[PRO],[REP], and files # are accessible in the sequence [FI1],[FI2],[FI3]. File [FI1], [FI2], [FI3] Mask CLIENT [CLI], PRODUITS [PRO], REPRES [REP] Default [F], [M], [V], [S] # Only class [V] may be used for variables without class Default [V], [V]
The command Default is used to define the sequence in which Adonix tries to find variables whose class is not specified, with the various syntaxes given below:
The syntax Default Mask is used to specify the default mask. This mask will be used by default:
· when using Affzo, Effzo without specifying the mask concerned;
· when using a variable with class [M], it will be searched for first in the default mask. If it is not found in this mask, it will then be sought in the others.
The syntax Default File is used to specify the default file. This file will be used by default:
· when using Read, For, Look, Readlock, Write, Delete, Rewrite without specifying the file concerned;
· when using a variable with class [F], it will be searched for first in the default mask. If it is not found in this file, it will then be sought in the others.
The syntax Default class is used to specify the variable class to be used by default when a variable is not preceded by any class indicator. If the variable cannot be found in the default class, it may be sought in the other classes.
The syntax Default list_classes is used to give a complete list of classes (there must be at least two) for the search for variables when no class is specified. From the time a list of classes is given, only those in the list are used to search for variables. Warning, if class [S] is excluded from this list, there is no access to Adonix system variables unless they are preceded by [S].
The two syntaxes Default Local and Default Global are used to define the class used to create default variables. Remember that variables may be created automatically by a routine, a procedure or a menu during allocation. If the variable to which a value is assigned has no class, and if it does not exist, it will be created automatically with a type matching that of the expression assigned, selected from Date, Decimal and Char, with maximum length. The class in which the variable is created will therefore be [V] if using Default Global and [L] if using Default Local.
At all times, Adonix keeps a list of default classes, a list of default masks, a list of default files and a default window. These lists are used to search for variables and to define default arguments.
The list of default masks is modified by:
· the Mask command which puts only masks declared in the list, in the order in which they are declared;
· the Default Mask command that puts the mask given at the head of the list;
· the page input (temporary): the current mask is put at the top of the list on starting up, control, selection or help on a zone.
The list of default files is modified by:
· the File command which puts only files declared in the list, in the order in which they are declared;
· the Default File command that puts the file given at the head of the list;
The list of default classes is modified by:
· the command Default followed by a list of classes, giving a complete list of classes;
· the Default command followed by a single class, that puts the class given at the top of the list of default classes.
· the page input (temporary): the current mask is put at the top of the list on starting up, control, selection or help on a zone.
The list of default classes is restored when returning from a sub-programme.
For several default classes, without giving a complete list of the classes, simply write several Default commands, giving a class each time, in the reverse order of preference. For a single exclusive search class, simply give one Default command, and the class twice. The following diagram explains the procedure:
|
AFTER THE COMMAND… |
THE LIST OF DEFAULTS IS… |
|
Default [z] |
cl1 cl2 cl3 x cl4 y z ... |
In a routine, the default option is Default Global; in a sub-programme it is Default Local.
Take care not to confuse Default [L] and Default Local. The first syntax specifies that a given variable, without class, is searched for by default in class [L]; the second specifies that if a variable does not exist, it will be created by default in class [L].
Take care not to omit [S] from the list of classes when giving a complete list in a Default command. In this case, all the Adonix system variables would then become inaccessible, unless the name was always preceded by an [S]. When [M] appears in a list of default classes it means that all the masks in the list are default masks. Similarly, when [F] is used, it is the default file list.
These lists of masks and files are current lists, and as they change, so does the list of default classes. For example:
File [FX], [FY], [FZ]
Mask [M1], [M2], [M3]
# After the following order, the default classes appear in the following
sequence:
# [V], [S], [FX], [FY], [FZ], [M1], [M2], [M3], [C]
Default [V], [S], [F], [M], [C]
#
# After the File and Mask commands below, the default classes
# become: [V], [S], [FA], [FB], [M1], [C]
File [FA], [FB] : Mask [M1]
If there is no Defaultcommand, when a programme is run, the default classes are those given by the command:
Default [S], [L], [V], [M], [F]
|
Error |
Description |
|
ERCLAS ( 7) |
The class does not exist (for a mask or file, this means it has not been declared in the previous Mask or File command). |
MASK - EFFZO - AFFZO - FILE - READ - FOR - LOOK - READLOCK - WRITE - REWRITE DELETE - LOCAL - GLOBAL
|
|