DESCRIPTION:
Extracts the text of the SourceValue from the Condition1Value character to the Condition2Value character.
EXAMPLE:
Extract from this generic code (88-1234Z) from the character "-" to "4".
OriginValue: "88-1234Z".
Condition1Value: "-"
Condition2Value: "4".
ProcessValue: "1234"
CONFIGURATION:
Value | Value2 | Relation | Relationship2 | Operation | Factor |
- | 4 | Extract from to | |||
CODE:
If SourceValue "" Then
If Condition1Value "" Then
If Condition2Value "" Then
If IsNumeric(Condition1Relation) Then
Else
Condition1Relationship = 0
End If
If IsNumeric(Condition2Relation) Then
Else
Condition2Relationship = 0
End If
Dim Position1 As Integer = 0
Dim Position2 As Integer = 0
If Condition1Value = "Start" Then
Position1 = 0
Else
Position1 = SourceValue.IndexOf(Condition1Value)
End If
If Condition2Value = "End" Then
Position2 = SourceValue.Length
Else
Position2 = SourceValue.IndexOf(Condition2Value)
End If
Dim Total As Integer = ValorOrigen.Length
ProcessedValue = SourceValue.Substring(Position1 + Condition1Relation, Position2 - Position1 + Condition2Relation)
End If
End If