Initializing help system before first use

Example

Below we show how to define constants of different types (integer, real, string, Boolean). Once this module with the name myconstants is completed, we can write a simple model to output the constants:

model "test myconstants module"
 uses "myconstants"

 writeln(MYCST_LINE)
 writeln("BigM value: ", MYCST_BIGM, ", tolerance value: ", MYCST_TOL)
 writeln("Boolean flags: ", MYCST_FLAG, " ", MYCST_NOFLAG)
 writeln(MYCST_LINE)

end-model

The result that we expect to see printed is the following:

----
BigM value: 10000, tolerance value: 1e-05
Boolean flags: true false
----

Without the need to write such a test program, we could use the Mosel command

examine myconstants

which will list all constants and (if there were any) subroutines, types and parameters, defined by the module myconstants.

To prevent name clashes between constants that are provided by different modules, a good habit to get into is to use prefixes (e.g. based on the module name) in the names of constants, as is done in the following example.

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.