StrTran()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

StrTran()

Syntax

StrTran( <CharacterValue1>, <CharacterValue2>, <CharacterValue3> )

 

Purpose

To return <CharacterValue1> translated in such a fashion that all occurrences of <CharacterValue2> within <CharacterValue1> are replaced by <CharacterValue3>.

 

Parameters

<CharacterValue1> is the character value to do translations within.

 

<CharacterValue2> is the value to find.

 

<CharacterValue3> is the value to replace the occurrences of <CharacterValue2> with.

 

Returns

A Character value.

 

Usage

This is a very powerful function, designed to perform a search-and-replace within a character value. This function gives you the ability to translate the contents of fields during a report.

 

Examples

When printing the contents of memo lines during a report, let's say you wanted to replace all occurrence of the key word "Music" with "**Music" to attract attention on the printed report. You could do this by entering the following expression for the report Field Name/Expression of the report column containing the memo text:

 

StrTran( .Memo_Text., "Music", "**Music" )

 

StrTran( .Note_Pad., "Tomorrow Never Knows", "Tomorrow Is Now" )

 

NCC-1701