' VFP inlist equivalent ' expO1 Item where all the items will be tried to look into ' expO2 Param array for a list of items Public Function Inlist(ByVal toItem As IComparable, ByVal ParamArray toItems() As IComparable) As Boolean Return Array.IndexOf(toItems, toItem) <> -1 End FunctionTonight, I found something strange. I have the following code:
If oApp.Inlist(loRow("Type"), 1, 3) Then cHtml = cHtml + "313" Else cHtml = cHtml + "405" End IfThe value of loRow("Type") is 3. I also show it by adding a line just before the condition and it is in fact showing 3. But, it goes in the 405 condition. If I change to this:
If oApp.Inlist(3, 1, 3) Then cHtml = cHtml + "313" Else cHtml = cHtml + "405" End IfIt works as expected. Can you see something that could be in effect here to obtain that weird behavior when using a datarow?
If oApp.Inlist(CType(loRow("Type"), System.Int32), 1, 3) Then cHtml = cHtml + "313" Else cHtml = cHtml + "405" End IfIt works as expected. But, I don't want to be forced to make that conversion everytime I want to verify for numeric values in Inlist(). The field Type is of Numeric 1 from a VFP table.