FNTUDR Functions(4.1)

The functions described below operate on UDRs of type FNTUDR. The value in an FNTUDR is a delimited string, representing file system paths and filenames.

The FNTUDR types are usually used in two different cases:

  • To create a dynamic path and filename for the output file from a disk oriented forwarding agent. The path and filename is created in APL using any APL strings. The path is defined relative to the configured output directory path for the agent.
  • To group output data using a disk oriented forwarding agent set to expect input of MultiForwardingUDR type. The MultiForwardingUDR has two fields. The first contains the data that will be written in the output file. The second contains filename and path specified by the FNTUDR. Both fields are mandatory unless the Produce Empty Files check box is selected in the agent, in this case the data field is not required.

Simply put, FNTUDR is a filename including directory or path if applicable, while MultiForwardingUDR contains the actual data or content to send plus the filename and path to write to.

For further information about using the MultiForwardingUDR, including APL code examples, refer to the respective file based forwarding agent documentation.

Example - How an FNTUDR is constructed

The following APL code shows how a FNTUDR is constructed. You set up a path (directory + filename) relative to the configured output directory path for the agent. The path is built up by adding components separated by "DirDelimiter". For example:

fntAddString(fntudr, "folder");
fntAddDirDelimiter(fntudr);
fntAddString(fntudr, "folder");
fntAddDirDelimiter(fntudr);
fntAddString(fntudr, "filename");

fntAddString

The fntAddString function appends a text string to the specified FNTUDR.

void fntAddString(
 FNTUDR fntudr, 
 string str, 
 int size, (optional) 
 string padding, (optional)
 boolean leftAlignment (optional) )
ParameterDescription

fntudr

The FNTUDR that the text string is going to be added to. A runtime error will occur, if the parameter is null.

str

The string to be added. If the string is null a runtime error will occur. The string can be extended or truncated if the size parameter (below) is specified and the string does not match in terms of length.

Note!

Do not include directory delimiters, for example "/", in the string. To add delimiters, use the fntAddDirDelimiter function instead.

size

The optional parameter size defines a fixed size for the appended string. A runtime error will occur if the size is not greater than zero.

If the size parameter is not specified, the parameters padding and leftAlignment are ignored.

padding

The optional parameter padding defines a padding string that will be repeated to fill the string to the size specified in the size parameter. A default padding (the default padding is underscore, "_") is used if the argument is not specified or if the padding string is null or an empty string.

leftAlignment

The optional parameter leftAlignment specifies if the padding shall be kept right or left of the string. If the parameter's value is true the string is left-aligned and the padding is added to the right. Default is left-aligned if the parameter is not specified.

Returns

Nothing

fntAddDirDelimiter

The fntAddDirDelimiter function adds a directory delimiter to the end of the FNTUDR.

void fntAddDirDelimiter(FNTUDR fntudr)
ParameterDescription

fntudr

The FNTUDR that the directory delimiter is going to be added to. A runtime error will occur, if the parameter is null.

Returns

Nothing