R RB Smissaert Well-Known Member Licensed User Longtime User Apr 27, 2020 #1 Trying to handle null values in this loop: Code: Copy Dim arrRow() As String Dim arrColInt(Data.Size) As Int For i = 0 To lUB arrRow = DataTemp.Get(i) Try arrColInt(i) = arrRow(col) Catch 'just do nil as QSort1DInt_IDX can cope with nulls End Try Next This works perfectly fine as I know what throws the error (null values) and it fine to have an empty array element (arrColInt(i)) So, this works as an On Error Resume Next and can't see any problem with it. Still, the IDE is not happy with this: Empty Catch block. You should at least add a log. Is there anything wrong with this? Would there be any mileage in having On Error Resume Next (+ On Error GoTo 0) and avoid the IDE warning? RBS
Trying to handle null values in this loop: Code: Copy Dim arrRow() As String Dim arrColInt(Data.Size) As Int For i = 0 To lUB arrRow = DataTemp.Get(i) Try arrColInt(i) = arrRow(col) Catch 'just do nil as QSort1DInt_IDX can cope with nulls End Try Next This works perfectly fine as I know what throws the error (null values) and it fine to have an empty array element (arrColInt(i)) So, this works as an On Error Resume Next and can't see any problem with it. Still, the IDE is not happy with this: Empty Catch block. You should at least add a log. Is there anything wrong with this? Would there be any mileage in having On Error Resume Next (+ On Error GoTo 0) and avoid the IDE warning? RBS
OliverA Expert Licensed User Longtime User Apr 27, 2020 #2 RB Smissaert said: and avoid the IDE warning? Click to expand... Just block the warning with an 'ignore Code: Copy Try arrColInt(i) = arrRow(col) Catch 'just do nil as QSort1DInt_IDX can cope with nulls End Try 'ignore There are always exceptions to the rule and you've made your case, so ignore the warning (and hide it with 'ignore) Upvote 0
RB Smissaert said: and avoid the IDE warning? Click to expand... Just block the warning with an 'ignore Code: Copy Try arrColInt(i) = arrRow(col) Catch 'just do nil as QSort1DInt_IDX can cope with nulls End Try 'ignore There are always exceptions to the rule and you've made your case, so ignore the warning (and hide it with 'ignore)
R RB Smissaert Well-Known Member Licensed User Longtime User Apr 27, 2020 #3 Thanks, wasn't aware of that option. RBS Upvote 0