This section of the initialization file must be present. This part of the initialization file begins by the line containing the keyword !mode. In the next line is the prompt that will characterize this running mode. There can be several successive such pairs of lines, defining other running modes. The commands and programs understood by the interpreter, and the objects and structures too, can be defined in such a way that they can be used only in some running modes.
If there are several running modes, the first that is defined has number
0, the second number 1, etc. The actual running mode for a given thread is
contained in the variable
flow_interp->MODE_FONCT_ , where flow_interp points to the flow_data structure associated to the thread (cf. 10). It controls the prompt that is printed when the program is waiting for a command or when commands are executed, and which programs, commands, objects and structures can be used. The user must provide commands to go from a running mode to another, if there are several running modes. Such a command will change the variable flow_interp->MODE_FONCT_ (where flow_interp is the address of the flow_data structure describing the current thread) and may perform some initializations before entering the new running mode.
When the interpreter begins the running mode is the first (number 0). When several running modes are needed it is a good idea to keep this first mode empty, that is to use it only to go into the useful running modes. In this case the user should also provide and end command to leave the useful running modes and to go in mode 0.
Example : Here 3 running modes are defined in the initialization file :
!mode ----- Mode 0 ----> !mode ----- Mode 1 ----> !mode ----- Mode 2 ---->