GetValueByTag()



Description

Use GetValueByTag() when the input fields are marked by tags and are not separated by constant delimiters. After the input value is retrieved, it can be assigned to an arbitrary output field.

Syntax

Function GetValueByTag( tag, [delimiter], [start] )

Parameters

string tag - string value to search for in the input record. Next character after the tag will be the beginning of the input field if found.
string delimiter (optional) - a string indicating the end of the field.
You can use the field delimiter syntax for multiple delimiters. The field delimiter option will be used if this parameter is not set.
Use VB script string constants for special symbols:
vbTab - horizontal tab
vbCr - carriage return
vbLf - line feed
or
"<Tab>" - horizontal tab
"<CR>" - carriage return
"<LF>" - line feed
"<FF>" - form feed
integer start (optional) - starting position for the search.
Set this parameter to a value greater than 0 to start the search from a certain position (the first position is 1).
Set this parameter to 0 to continue search from the the previous successful search position.
The default is 1 - the beginning of the line.

Return value

string - the field's value
Empty if the field is not found or has an empty value.

Example



Author="Aberer, Karl",
Title="The Use of Object-oriented Data Models in Biomolecular Databases",
BookTitle="Conf. on Object-Oriented Computing in the Natural Sciences",
Address="Heidelberg, Germany",
Year=1994

with the following script:

Function OnRecord
OutDict.Field1.value = this.GetValueByTag( "Author" )
OutDict.Field2.value = this.GetValueByTag( "Title" )
OutDict.Field3.value = this.GetValueByTag( "BookTitle" )
OutDict.Field4.value = this.GetValueByTag( "Address" )
OutDict.Field5.value = this.GetValueByTag( "Year" )
End Function 

See also