FNTUDR Functions

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

The FNTUDR types are usually used in two different cases:

  • Creation of a dynamic path for the output file from a disk oriented forwarding agent. Using the filename template in the forwarding agent the FNTUDR value is, via a MIM resource, used to publish the respective MIM value. For further information about using the FNTUDR in filename templates, see the relevant agent documentation in the Desktop User's Guide.
  • Grouping of 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.

For further information about using the MultiForwardingUDR, please refer to respective file based forwarding agents documentation.

Example - How an FNTUDR is constructed

The following APL code shows how a FNTUDR is constructed with the help of the functions that are described in this section.

import ultra.FNT;
consume { 
 FNTUDR fntudr = udrCreate(FNTUDR);
 fntAddString(fntudr, "ready_folder");
 fntAddDirDelimiter(fntudr);
 date now = dateCreateNow();
 fntAddString(fntudr, ""+dateGetYear(now) + "-"); fntAddString(fntudr, ""+dateGetMonth(now), 2, "0", false); fntAddString(fntudr, "-");
 fntAddString(fntudr, ""+dateGetDay(now), 2, "0", false); 
}

The fntudr variable will have a value corresponding to a path like ready_folder/2018-10-31, where the character '/' represent a directory delimiter that can be any character, depending on the target system.

The following functions for FNTUDR described here are:

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 that will be added. If the string is null a runtime error will occur. The string can be extended or truncated if the size parameter is specified and the string does not match.

Note!

Do not include directory delimiters, e g "/", 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 isn't greater than zero.

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 will be used if the argument isn't 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 parameters value is true the string will be left aligned and the padding will added to the right. If the parameter isn't specified, the default setting is left aligned.

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 text delimiter is going to be added to. A runtime error will occur, if the parameter is null.

Returns

Nothing