VB.Net/Language Basics/IIf

Материал из VB Эксперт
Перейти к: навигация, поиск

IIf Demo

Imports System
public class MainClass
    Shared Sub Main()
         Dim valueOne As Integer = 10
         Dim valueTwo As Integer = 20
         Dim maxValue As Integer
         maxValue = CInt(IIf((valueOne > valueTwo), valueOne, valueTwo))
         Console.WriteLine("ValueOne: {0}, valueTwo: {1},  maxValue: {2}", _
           valueOne, valueTwo, maxValue)
    End Sub
End Class