Home | Table of Contents | Import | CloverETL 4.6.1
--- | --- | ---
Prev | Language Reference | Next

## Import

Import makes accessible functions from other `.ctl` files. It is similar to `import` statement in Java or to `include` statement in C/C++. Files to be included must be defined at the beginning before any other declaration(s) and/or statement(s).

-     import 'fileURL';

-     import "fileURL";

You must decide whether you want to use single or double quotes. Single quotes do not escape so called escape sequences. For more details see Literals below. For these `fileURL`, you must type the URL of some existing source code file.

Example 59.2. Example of an import of a CTL file

    //#CTL2

    import "trans/filterFunctions.ctl";

    function integer transform() {
        $out.0.field1 = filterChars($in.0.field1);

        return ALL;
    }

You can use graph parameters to define a name of an imported file.

Example 59.3. Example of an import of a CTL file with a graph parameter

    //#CTL2

    import "${FUNCTION_DIR}/filterFunctions.ctl";

    function integer transform() {
        $out.0.field1 = filterChars($in.0.field1);

        return ALL;
    }

Prev | Up | Next
Comments | Home | Table of Contents | Data Types in CTL2