Creating Runtime Parameter Fields

Runtime parameters are user-defined values that are requested when a model is loaded. Runtime parameters allow you to enter a value that is not necessarily contained within the report, such as today's exchange rate.

Runtime parameters are very much like calculated fields. They have normal field names and data types. They can be used just like any other field in the formulas of regular calculated fields and filters. They can appear as a column in table view or be hidden. The big difference between calculated fields and runtime parameters is that runtime parameters do not have a formula, just a simple string, number, or date value.

The user supplies the value for each runtime parameter at the time the model is loaded. If the model defines one or more runtime parameters, the user is automatically presented with the Runtime Parameters dialog in which to enter the desired values. This same dialog box can be accessed at any time in the Monarch Classic session via the Edit, Runtime Parameters menu option.

In addition to having a value, each runtime parameter has a description string and two flags: "save in registry" and "required". The description string serves as a prompt in the Runtime Parameters dialog to help the user understand what value is expected. The "save in registry" option determines whether or not Monarch Classic preserves the most recent value of this parameter in the registry. Parameters with values that are not preserved must be reentered each time the model is loaded. The "required" option determines whether or not a blank (empty) value is accepted for the parameter.

Note that when you are creating several similar fields you can save time by using the first definition as the starting point for subsequent definitions. Refer to Duplicating Fields for details.

  1. Select Add, and then Runtime Fields on the Table Design ribbon. The Runtime Parameter Field Properties window displays.

  2. On the General tab, enter an appropriate name for the calculated field in the Name box, and then click on the green check icon to accept.

    Field names may be up to 62 characters in length and may contain uppercase and lowercase characters, spaces, and punctuation except for periods (.), exclamation points (!), accent graves (`), and brackets ([ ]). Names may begin with any character, except for an underscore or space. If a name is entered with leading spaces, the name is accepted but the leading spaces are ignored.

    Note: If you elect to enforce DBF field naming rules, field names must adhere to the dBASE III field naming conventions. Names may be up to ten characters long and may contain any letter or number and the underscore character (_). The first character must be a letter. Spaces and punctuation are not allowed.

  3. From the Type drop-down list, select the appropriate field type. The available types are Character, Date/Time, and Numeric. For a description of each option see Changing field types.

  4. For numeric fields, specify the decimal accuracy in the Decimals box.

    Enter the number of decimal places that you want to calculate for this field. Ensure that the data length value (described below) is large enough to accommodate both the integer portion and the decimal portion of the largest number that your field expression is likely to produce.

  5. From the Format drop-down list, select the desired setting. The format settings available are determined by the field type you specified in Step 5 above. For example, if you select the Date field type, the format options available are General, Short Date, Long Date, Short Date & Time, Long Date & Time, and Time. If you select the Numeric field type, the format options available are General, Thousands, Currency, Percentage, and Time span. If you select the Character field type, only the General Format option is available. For a description of each of these format options, see Changing field types.

  6. Enter the desired column width in the Display Width box.

    Note: The Display Width setting affects only the appearance of the data on screen; the underlying data is not affected. If the column width of a character field or a date field is not wide enough to accommodate a field value, the field value is truncated on screen. If the column width of a numeric field is not wide enough to accommodate a field value, the field value displays as pound signs (####).

  7. Select the Hidden check box if you don't want the calculated field to be visible in the Table window. Hidden fields can be easily viewed by selecting Hide/Display Fields on the View group of the Table window.

  8. Specify the desired alignment for the calculated field by selecting one of the following:

    • Left: select for a left-aligned calculated field.

    • Right: select for a right-aligned calculated field.

    • Center: select for a center-aligned calculated field.

  9. Enter an appropriate data length in the Data Length box.

    • Setting data length for character fields: Character fields may be up to 254 characters in length. Set the data length to a value large enough to accommodate the longest character string that your calculated field expression is likely to produce. If the data length is too short to accommodate a value, that value is truncated.

    • Setting data length for date/time fields: For date/time fields, Monarch Classic automatically sets the data length to 8 and the Data Length box is grayed.

    • Setting data length for numeric fields: Numeric fields may contain up to 15 significant digits and an optional decimal point and negation sign. Set the data length to a value large enough to accommodate the largest number, including decimal places, that your calculated field expression is likely to produce. If the data length is too short to accommodate a value, that value will be blanked.

    • Setting data length for memo fields: Memo fields have a fixed size of 65536 characters, so the Data Length box is grayed.

  10. Click on the Runtime Parameter tab.

  11. In the Current Value field, enter a value for the parameter.

    Note: The value you specify must be compatible with the field type selected on the General tab. If the value and field type are incompatible (e.g., if you specify a field type of Character, and then enter a number in the Current Value field), when you click the OK button an error message is displayed.

  12. In the Description field, you may enter a description of the runtime parameter. This description will appear in the Runtime Parameters dialog when you open the model that contains this runtime parameter calculated field.

  13. If you want the current value to be saved in the Registry between Monarch Classic sessions, select the Save Value in Registry Between Runs check box. If you don't select this check box, the current value will only be available for the current Monarch Classic session.

  14. If you want to require that a value for the parameter be specified when the model that contains this calculated field is opened, select the Non-Blank Value is Required check box.

  15. Choose Accept to accept the calculated field definition, otherwise choose Cancel.

    Monarch Classic displays the new calculated field after the last field in the table. To view the field, scroll all the way to the right. To position the field elsewhere in the table, see Moving Fields in the Table window.

 

 

 

(c) 2023 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support