Fmt(); Formatfordisplay() - IBM Prerequisite Scanner User Manual

Table of Contents

Advertisement

fmt()

Modifies a string by adding a specified number of characters from another string
to it and padding the other string with space characters if the length of the other
string is too short or truncating the other string if it is too long.
Purpose
This function searches for the %#s expression inside the s input parameter of type
string. The %#s expression determines the specified # number of characters from
the args input parameter that are added to the first string at the position of that
expression. If the specified # is greater than the length of the args input parameter,
the difference is padded by space characters. If the specified # is less than the
length of the args input parameter, the length is truncated by the difference. If the
specified # is 0, the full length of the args input parameter is added to the first
string at the appropriate position in the string.
Syntax
fmt(s, args)
Input parameters
String s
Array args
Return values
String result
Example
fmt("Hello %5s!",array("Neo")) returns "Hello Neo !" padded with extra space characters
fmt("Hello %5s!",array("Mr. Anderson")) returns "Hello Mr. A!" truncated to add only "Mr. A"
fmt("Hello %0s!",array("Mr. Anderson")) returns "Hello Mr. Anderson!"

formatForDisplay()

Formats the input parameter to make it readable.
Purpose
This function calls the "formatSizeForDisplay()" on page 121 function to format the
input parameter.
Syntax
formatForDisplay(val)
Input parameters
Variable val
120
Prerequisite Scanner: User's Guide
v pd.cfg , the latest version of the generic configuration file for the product, if
no file containing the version input parameter was found.
Contains the string to modify by the specified # number of characters in the
%#s expression inside that string.
Contains the set of characters that modify the s input parameter.
Returns the modified string.
The variable to format.

Advertisement

Table of Contents
loading

Table of Contents