GetValueByTag()

This.GetValueByTag() function is obsolete and that is why it is not shown in the fly menu. It is kept operational for backward compatibility purposes. TextConverter offers several much more powerful functions instead: Trg.strlib.Mid(), This.GetText() and This.GetLine().

 

---------------

Trg.strlib.Mid( input_str, left_tag, right_tag, look_for, pos )

Extracts substring using two tags (start/end) and an extraction mask – all three are regular expressions.

 

Return value: string


Parameters:

Parameter         Type           Status         Description

input_str             String                            Input string to be parsed

left_tag              String         (optional)     Defines the starting position for the data extraction. If omitted assumes extraction from the beginning of the input string.

right_tag             String         (optional)     Defines the ending position for the data extraction.

look_for              String         (optional)     Defines the string to be extracted.

pos                    Integer        (optional)     Position to start parsing from (default is 1)


Sample:

 

Dim str, var1

str = “   Account #     123456

Var1 = Trg.strlib.Mid(str, “Account # +”, “$”)

 

Returned value: 123456

 

---------------

This.GetText( tag, x, dx, y, dy, bottom_tag )

Extracts data from a rectangular area positioned relative to a regular expression defined tag.

 

Return value: string

 

Parameter          Type           Description

tag                     String          Regular expression defining the anchor position for the data extraction. If set то empty assumes extraction from the beginning of the input line.

x                        Integer         Left position relative to the anchor of the data extraction rectangle. Assumed 0 if omitted.

dx                      Integer         Length of the extraction rectangle. Assumed not limited if omitted.

y                        Integer         Starting line for data extraction relative to the current one. For example -1 is the previous, 2 – is the second down.

dy                      Integer         Number of lines to process

bottom_tag        String          Regular expression defining the line where to quit processing the extraction process.

Comments