Move declarations into a second file
Save the rater aspersonal-auto/rater.rsl. This file is the entry point: the file you check, export and build.
Complete example: personal-auto/rater.rsl
Complete example: personal-auto/rater.rsl
personal-auto/rater.rsl
personal-auto/territory.rsl:
personal-auto/territory.rsl
personal-auto/tables/TerritoryFactor.csv:
personal-auto/tables/TerritoryFactor.csv
rater.rsl, each file it imports and each table, and checks them as one rater.
Build and rate it the same way as a rater in one file:
600 × 1.25 × 0.92 = 690.
Follow the import rules
- Write each
importon its own line, outside the sections. The example writes its imports afterspec. - A path is relative to the file that writes the
import. A path that starts withstd/names the standard library. - An imported file holds sections such as
Types,ConstantsandTables. The rater reads them as its own. - Each name has one declaration across the files.
- The
specblock of the entry point applies to every file. - An imported file may import other files. Two files that import each other fail the check.
- Keep each imported file inside the folder of the entry point. A bundle holds that one folder.
E-UNRESOLVED, with the file and the line.
Keep the CSV files beside the entry point
- The rater reads each table from
tables/beside the entry point, whichever file declares the table. - An enumeration declared as
Name = Enumreads its members fromenums/Name.csvbeside the entry point.
Check, format and export the rater
An imported file checked alone lacks the other files.
territory.rsl cites the source manual, which rater.rsl declares:
std/ppa.rsl stays out of the bundle.
Package a rater describes the other files.
Import from the standard library
The standard library holds value sets that many raters share. Import a file by itsstd/ path:
inputs lists the values each type accepts:
- The files install with the compiler, in the
stdfolder of therslcpackage. Read a file there for its full list. - Import one of these files in a rater. Several of them declare the same name, such as
MaritalStatus. - A name from an imported file is taken: choose a different name for your own type.
Related
- Use a filed rate table declares tables and their CSV files.
- Use the rslc commands covers
rslc check,rslc fmtandrslc export. - Versions explains how a bundle pins its source and tables.