String  

Search() Extract() Length()
ToString() ToReal() ReplaceSubText()
ToUpper() ToLower() BuildMessageNLS

Search()  

Searches for the first occurrence of a sub string in a String type parameter. Returns the index (o or 1) of the start of the substring. Returns -1 is the substring specified is not found.

Syntax

string.Search(StringToBeSearchedFor): Integer

where StringToBeSearchedFor is the name of the SubString parameter.

Example

Responsible = Cilas Evans = ...
SEvans = Evans
I1Search = 6 = Responsible.Search(SEvans)

Sample

KwrString.CATPart

Extract()  

Returns the sub string starting at a given position with a specified length.

Syntax

string.Extract(StartIndex: Integer, Length: Integer) : String

where StartIndex is the index (0 or 1) of the substring first character and Length the sub string length.

Example

Message (Responsible.Extract(2,2))

Sample

KwrString.CATPart

Length()  

Applies to a string type parameter. Returns the string length.

Syntax

string.Length(Integer

Sample

KwrString.CATPart

ToString()  

Converts an integer into a string. 

Syntax

ToString(Real) : String

Sample

KwrString.CATPart

ToReal()  

Converts a string into a real. 

Syntax

String.ToReal(Real): Real

ReplaceSubText()  

Replaces a sub string with another substring within a character string.

Syntax

ReplaceSubText(InputString: String, SubStringToBeReplaced: String, ReplacingSubString: String): String

Arguments 2 and 3 can be specified either with their parameters names or with the string itself between quotes.

Sample

KwrString.CATPart

ToUpper()  

Changes all lower-case letters of a string to upper-case.

Syntax

ToUpper(StringTobeConverted: String): String

where StringTobeConverted is name of the string type parameter.

Sample

KwrString.CATPart

ToLower()  

Changes all upper-case letters of a string to lower-case.

Syntax

ToLower(StringTobeConverted: String): String

where StringTobeConverted is name of the string type parameter.

Sample

KwrString.CATPart

BuildMessageNLS

Enables you to send messages or ask questions through the Message and Question functions in the language of your choice. The BuildMessageNLS function can build a NLS message (a message in a given language) by finding it in a CATXXX.CATNls file.

Note that this function is useful when used together with the Message and Question functions. For more information about these 2 functions, see the Knowledge Advisor User's Guide.

Syntax

BuildMessageNLS(MessageCatalog:String, MessageKey: String, argument: Literal, ...):String

where:

Example

The KwrCATCatalog.CATNls file contains the following text.
 

Zero = "Zero";

One = "One /P1";

Two = "Two /P1 /P2";

Zero, One and Two are the messages. The first message has no arguments, the second has 1 argument, the third, 2 arguments.

To display those messages in a Knowledge Advisor rule for example, enter the following rule body:
 

Message (BuildMessageNLS("KwrCATCatalog","Zero"))

OR

Message (BuildMessageNLS("KwrCATCatalog","One",x))

Where x is a parameter.

OR

Message (BuildMessageNLS("KwrCATCatalog","Two",y,z))

Where y, and z are parameters.

 

  • If the function does not find the key or the .NLS catalog, it will return an empty string.
  • If there are too many parameters compared to the number of arguments of the message, the parameters will be ignored.
  • If there are too few parameters compared to the number of arguments of the message, the parameters will be replaced with a "???" string.
  • Note that the .NLS file is to be stored in the runtime view (in the msgcatalog directory)

Sample

KwrCATCatalog.CATPart (See Rule.2)