Skip to content

Screen Filters

Screen filters allow VIP to modify the text portion of a screen when generating default screens. Using screen filters will result in more presentable default and custom graphical screens.

The type of editing to be done to the screen text is controlled by a screen filter file. Screen filters are optional. If a screen filter file does not exist, no screen text editing is performed. Screen filters are global. That is, they apply to all screens whenever a default screen is generated.

The screen filter allows you to remove or replace characters originating in the character screen definition prior to generating a default graphical screen. This can be used to remove the “…:” typically found in character screen designs. The screen filter can also be used to clear entire rows from the character screen when generating a default graphical screen. This is useful if in your graphical screen (through the use of a template) you want the screen codes such as the installation name, date, operator code, etc. to appear in a header panel and do not want them in the body of the screen. The screen filter can clear these rows of text before generating the default graphical screen.

A default screen filter is distributed with VIP and placed in vip-data-path \Tsi\Scripts\Scrfilter.txt. Use Notepad.exe to edit the default screen filter file or create a new one. The screen filter file must have a .txt file extension.

The screen filter file must conform to the rules for a standard INI file. Comment lines begin with “ ; “ or “ # “ and may appear anywhere in the file. The first non-comment line must be:

[LABELEDIT]

Specifying a delimiter A delimiter is a single character that is used to separate label text. In almost all cases this should be a space. To specify the delimiter to be used in a screen filter file add this line:

Delimiter='x'

where x is usually a single space. The single quotes ( ’ ) are required.

Replacing characters in a text line In order to replace characters in a text line you must have previously specified a delimiter. The character defined as a delimiter is used to replace specified characters. To indicate what characters are to be replaced, add this line:

Replace='abc...'

where abc.. are any number of characters that are to be replaced in the text line. The single quotes ( ’ ) are not part of the string and cannot be included in the string. VIP will search for each character in the string and replace it with the delimiter character if the character is found.

Clearing a line of text The screen filter file can designate lines to be blanked out or cleared. The screen filter file allows for two clear line commands:

ClearLinStr1=string1
ClearLinStr2=string2
ClearLinStr1=^string1
ClearLinStr1=$string1
ClearLinStr1=~string1

where: string1 and string2 can contain any characters including embedded, leading, or trailing spaces, but they cannot contain the single quotes ( ’ ), which is used to delimit the string. Leading and trailing spaces are significant. The line will be removed if it matches exactly the specified string. The ^ character indicates the line is to be removed if it begins with ‘string1’. The $ character indicates the line is to be removed if it ends with string1. The ~ character indicates the line is to be removed if it contains string1 anywhere in the line.

Identifying labels Normally VIP will delimit labels in a text line by a single space. For example, the line Customer Name will contain two labels Customer and Name. A filter file can change the way VIP parses labels with this line:

Rule1=Y

If this line is included in the screen filter file, a single space will be considered part of the label text. For example, Customer Name will result in one label control being created because of the single space between Customer and Name. If two or more spaces exist between Customer and Name, two label controls will be created.

VIP processes the ClearLinStr commands before any characters are replaced in the text string. If the Delimiter command is missing the Replace command has no effect.

Integration in the Tbred.ini file If a screen filter file is to be used it must be specified in the Tbred.ini file. Add the following line to the [SCREENS] section of the Tbred.ini file:

Scrfilter=anyname

where anyname is the name of the screen filter file. This file can have any name and extension, but it must exist in the directory *vip-data-path\*Tsi\Scripts.

Sample Screen Filter File

[LABELEDIT]
#The delimiter is a space.
Delimiter=' '
#All space and ":" characters found in screen text lines will be
#replaced with a space.
Replace='.:'
#If a line contains "Company :"(Company followed by a space) or
#"Operator :" (Operator followed by a space) anywhere in the line, the
#entire line will be set to all spaces.
ClearLinStr1=~Company :
ClearLinStr2=~Operator :
#Text strings separated by a single space will be considered one label.
Rule1=Y

From the VIP for Dictionary-IV Reference, version 8.9.1. Open this page in the PDF