Thank you very much QTPKing.
I'm using a JTable so I modify a little bit your script (I also changed the For loops into While loops).
I'm using a JTable so I modify a little bit your script (I also changed the For loops into While loops).
Code:
'String which enable to identify the line
id = "090701224501893r"
'Column where we will search id
colIdLabel = "FIX.4.2"
'Column of the expected value
colExLabel = 8
If JavaWindow("Log Message").JavaTable("MessageTable").Exist Then
nbCol = JavaWindow("Log Message").JavaTable("MessageTable").GetROProperty("cols")
'We are trying to find 2 columns (one for the id and one for the expected value)
nbFindCol = 0
'Find the expected columns
i = 0
While nbFindCol<2 and i<nbCol
If JavaWindow("Log Message").JavaTable("MessageTable").GetCellData(0, i) = colIdLabel Then
colIdNum = i
nbFindCol = nbFindCol +1
End If
If JavaWindow("Log Message").JavaTable("MessageTable").GetCellData(0, i) = colExLabel Then
colExNum = i
nbFindCol = nbFindCol +1
End If
i = i+1
Wend
If nbFindCol <> 2 Then
msgbox "Error : one of the column has not been found"
Else
nbRow = JavaWindow("Log Message").JavaTable("MessageTable").GetROProperty("rows")
'Find the expected row
i = 0
found = false
While found = false and i<nbRow
If JavaWindow("Log Message").JavaTable("MessageTable").GetCellData(i,colIdNum) = id Then
rowExNum = i
found = true
End If
i = i + 1
Wend
msgbox JavaWindow("Log Message").JavaTable("MessageTable").GetCellData(rowExNum,colExNum)
End If
Else
msgbox "The Java Table doesn't exists"
End If
