トップページ > プログラム > 2017年08月12日 > QjNv8My6

書き込み順位&時間帯一覧

14 位/200 ID中時間01234567891011121314151617181920212223Total
書き込み数0000000000010000000020104



使用した名前一覧書き込んだスレッド一覧
デフォルトの名無しさん
VB.NET質問スレ(Part43) [無断転載禁止]©2ch.net

書き込みレス一覧

VB.NET質問スレ(Part43) [無断転載禁止]©2ch.net
659 :デフォルトの名無しさん[]:2017/08/12(土) 11:40:48.61 ID:QjNv8My6
dictionary ( of integer, string) のofってなんですか?
VB.NET質問スレ(Part43) [無断転載禁止]©2ch.net
664 :デフォルトの名無しさん[]:2017/08/12(土) 20:14:41.43 ID:QjNv8My6
前の引数だけOFが付いてるのは何故なんだろう?
VB.NET質問スレ(Part43) [無断転載禁止]©2ch.net
665 :デフォルトの名無しさん[]:2017/08/12(土) 20:37:36.82 ID:QjNv8My6
>660
良い資料ありがとう。意味わかりました。ofは両方の引数にかかるんだ。
VB.NET質問スレ(Part43) [無断転載禁止]©2ch.net
667 :デフォルトの名無しさん[]:2017/08/12(土) 22:39:38.37 ID:QjNv8My6
Using the Of Keyword
The following code example uses the Of keyword to define the outline of a class that takes two type parameters.
It constrains the keyType parameter by the IComparable interface, which means the consuming code must supply
a type argument that implements IComparable. This is necessary so that the add procedure can call the System.
IComparable.CompareTo method.
For more information on constraints, see Type List.

Ofキーワードの使い方について
次のコード例はOfキーワードを使っているが、それは二つのタイプのパラメータを取るクラスの外形を定義している。
IComparableインターフェースのKeyTypeパラメータを含むが、ここで使われるコードにはIComparableを実装した引数を
あてなくてはならないということを意味する。これが必要なのはadd関数がシステムをコールのIComarable.CompareToを実行
できるようにするためである。さらに詳しくはListの項目を見ること

Public Class Dictionary(Of entryType, keyType As IComparable)
Public Sub add(ByVal e As entryType, ByVal k As keyType)
Dim dk As keyType
If k.CompareTo(dk) = 0 Then
End If
End Sub
Public Function find(ByVal k As keyType) As entryType
End Function
End Class


※このページは、『2ちゃんねる』の書き込みを基に自動生成したものです。オリジナルはリンク先の2ちゃんねるの書き込みです。
※このサイトでオリジナルの書き込みについては対応できません。
※何か問題のある場合はメールをしてください。対応します。