Kofax INDICIUS 6.0 User Manual
Page 67
Configuring Recognition
Getting Started Guide (Free-Form)
61
Function
MatchValue_Format(sSearchName, sValue)
Dim
lRet
Select Case
sSearchName
Case
"Date"
'Convert the date to MMDDYYYY format
'The date (sValue) is reformatted within the function and returned as sValue
'If lRet is < 0 an error has occurred
lRet
=
LibFreeForm_FormatDate(sValue)
If
lRet < 0
Then
Recog.LogMessage
"LibFreeForm_FormatDate failed. Error code: " & lRet, 1
MatchValue_Format
=
""
Exit Function
End If
MatchValue_Format
=
sValue
Case
"AccountNo"
'Insert formatting for search 'AccountNo' here...
MatchValue_Format
=
sValue
Case
"TransferDate"
'Remove the on or at from the start of the value
sValue
=
Mid
(sValue,3)
'Convert the date to MMDDYYYY format
'The date (sValue) is reformatted within the function and returned as sValue
'If lRet is < 0 an error has occurred
lRet
=
LibFreeForm_FormatDate(sValue)
If
lRet < 0
Then
Recog.LogMessage
"LibFreeForm_FormatDate failed. Error code: " & lRet, 1
MatchValue_Format
=
""
Exit Function
End If
MatchValue_Format
=
sValue
Case
"ZipCode"
'Insert formatting for search 'ZipCode' here...
MatchValue_Format
=
sValue
'** Insert cases for new searches here **
Case
Else
'This case catches any searches with formatting turned on but
'no case defined above.
MatchValue_Format
=
sValue
End Select
End Function
Figure 5-22. MatchValue_Format Function, Case “TransferDate”
X
To run the format script
Now that the format script has been created, each search must use it prior to
returning matches. The property Run Format Script must be changed to True for
each search.
1
Move back to the image view by selecting the Image tab.
2
Select the “Date” search from the drop down list at the top of the window.
3
On the Advanced panel under Scripts, change the value of the Run Format
Script property to True.
4
Test the search.
The Search Results panel in the bottom left will show the formatted match.