Triangular operators in VB!

xiaoxiao2021-03-06  50

Everyone knows the three-mean operator (? :) format in C , C #, in fact, the same alternatives in VB.NET. I remember that I have seen this operator when I first started learning VB.NET. At that time, I just remember that there is such a thing in VB.NET, and I have forgotten the time. Later, in the process of programming, this function is used, but I can't afford to get this operator in VB.NET. A few days ago, I saw a netizen writing something, and suddenly I saw a long-lost IIF, so I plan to record it here, one is to do my own memo, and the other is for resource sharing. Of course, many friends may know this thing, but I am more lonely, so if you laugh at my ignorance, I will smile! Here is a few simple code: private sub button2_click (Byval e as system.EventArgs) Handles Button2.Click Dim Strresult As String Strresult = IIF (2 <4, "Yes", "NO") Debug.writeLine (Strresult)

End Sub **************************************************************************************************************************************************** ************

转载请注明原文地址:https://www.9cbs.com/read-80990.html

New Post(0)