Help us understand the problem. What is going on with this article?

VisualBasic .net 15 の新機能

More than 1 year has passed since last update.

環境

VisualStudio 2017.1
Visual Basic Compiler 2.1.0.61520
Windows 10 Creators Update

Binary Literals (バイナリ表記のリテラル)

1と0(2進数)を用いて値が表せるになりました.

Dim i As Integer = &B1101
Console.WriteLine(i) ' → 13

Digit Separators (桁区切り)

'_' をもちいて桁区切りができるようになりました.

Dim d As Integer = &B11___0_1
Console.WriteLine(i)

Tuples(タプルの言語サポート強化)

この機能は,System.Tupleではなくて,System.ValueTupleのみに使えるものです.
ターゲットフレームワークが.Net 4.7であれば,何も作業する必要はありませんが,それ以前のバージョンでは,Nugetから System.ValueTuple を導入する必要があります.

クリップボード01.jpg

具体的には,以下のように書けます.

Module Module1
    Sub Main()
        Dim point As (x As Integer, y As Integer) = GetPoint()
        Console.WriteLine(point.x)
        Console.WriteLine(point.Item1) '旧来のメンバ名でもおk
    End Sub
    Function GetPoint() As (x As Integer, y As Integer)
        Return (12, 20)
    End Function
End Module
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away