Loose types

A loose type is a special kind of primitive type that you can use only for function parameters. Use this type if you want the parameter to accept a range of argument lengths. The benefit is that you can invoke the same function repeatedly and can pass an argument of a different length each time.

Valid values are as follows:

If you want the parameter to accept a number of any numeric primitive type and length, specify NUMBER as the loose type.

If you want the parameter to accept a string of a particular primitive type but any length, specify CHAR, DBCHAR, MBCHAR, HEX, or UNICODE as the loose type and make sure that the argument is of the corresponding primitive type.

The definition of the parameter determines what occurs when a statement in the function operates on a variable of a loose type.

Loose types are not available in functions that are declared in libraries or services.

In a function declaration, loose types can carry the modifiers inOut or out, but not in.

For details on primitive types, see "Primitive types."

Compatibility considerations

Table 1. Compatibility considerations
Platform Issue
JavaScript generation The following types are supported: ANY, BIGINT, BIN (but only in the absence of decimal places), Boolean, DataItem, DATE, DECIMAL, Delegate, Dictionary, FLOAT, INT, NUM, NUMBER, SMALLFLOAT, SMALLINT, STRING (but only in the absence of a size limit) , TIME, TIMESTAMP, NUM, MONEY, Service parts, Interface parts, External types (stereotype JavaScript), arrays of supported types, and non-structured Basic, Exception, and SQL Record parts.

The following types are not supported: ArrayDictionary, BIN (with decimal places), BLOB, CHAR, CLOB, DBCHAR, HEX, INTERVAL, MBCHAR, NUMC, STRING (with a size limit), PACF, UNICODE, and structured Record parts.


Feedback