IsEmpty or IsNull or IsNothing?

Can someone help me determine what I should use?

Here is the situation: I am pulling a value from a column in a data table. If there is anything in this column, I set the data to a variable and execute the action. If the column is empty, I want to skip this.

I am confused as to which IsWHATEVER statement would be better. For example:

If IsEmpty(Datatable.Value("M4","Data_Entry"))=False Then

OR

If IsNull(Datatable.Value("M4","Data_Entry"))=False Then

OR

If IsNothing(Datatable.Value("M4","Data_Entry"))=False Then

Suggestions?

+3
source share
2 answers

I just tried all your options and found this the most correct:

If (DataTable.Value("M4","Global") <> "") Then

QTP Datatables, . QTP, Datatable, ( ).

+2

shreyansp.. 3

If len(trim(DataTable.Value("M4","Global"))>0 Then
   'Do code here
End If
0

All Articles