Sinan Tuzcu Well-Known Member Licensed User Longtime User Aug 19, 2021 #1 Hi, I get here a warning but I don't why. If I set the Number as String then I not get a warning. But then not works. What is the correct way in this case? BR Sinan
Hi, I get here a warning but I don't why. If I set the Number as String then I not get a warning. But then not works. What is the correct way in this case? BR Sinan
William Lancee Well-Known Member Licensed User Longtime User Aug 20, 2021 #3 @Peter Simpson's solution is correct but a bit cryptic. The reason is that "ClickPnl.tag" is an unspecified object. The solution works because the right hand of the = is converted to the type of the left. You could also use "If ClickPnl.Tag.As(Int) = 4 Then" Upvote 0
@Peter Simpson's solution is correct but a bit cryptic. The reason is that "ClickPnl.tag" is an unspecified object. The solution works because the right hand of the = is converted to the type of the left. You could also use "If ClickPnl.Tag.As(Int) = 4 Then"
josejad Expert Licensed User Longtime User Aug 20, 2021 #4 Peter Simpson said: If 4 = ClickPnl.Tag Then Click to expand... In fact, I think this is the way @Erel recommends in this thread New warning: "Comparison of Object to other types will fail if exact types do not match. Better to put the object on the right side of the comparison. (warning #35)" Sinan Tuzcu said: I get here a warning but I don't why. Click to expand... Explained in this post Upvote 0
Peter Simpson said: If 4 = ClickPnl.Tag Then Click to expand... In fact, I think this is the way @Erel recommends in this thread New warning: "Comparison of Object to other types will fail if exact types do not match. Better to put the object on the right side of the comparison. (warning #35)" Sinan Tuzcu said: I get here a warning but I don't why. Click to expand... Explained in this post