{"id":6328,"date":"2019-01-09T23:37:41","date_gmt":"2019-01-09T14:37:41","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=6328"},"modified":"2023-05-28T08:48:28","modified_gmt":"2023-05-27T23:48:28","slug":"%e3%80%90visual-basic%e3%80%91%e3%80%8c%e3%83%87%e3%83%aa%e3%82%b2%e3%83%bc%e3%83%88%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=6328","title":{"rendered":"\u3010VB.NET\u3011\u300c\u30c7\u30ea\u30b2\u30fc\u30c8\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u30c7\u30ea\u30b2\u30fc\u30c8\u3068\u306f\uff1f<\/h2>\n<p>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u624b\u6cd5\u306e\u4e00\u3064\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u3092\u76f4\u63a5\u547c\u3073\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001<span style=\"color: #ff0000;\"><strong>\u8ab0\u304b\u306b\u4f9d\u983c\u3092\u3057\u3066\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p>\u3053\u306e\u8ab0\u304b\u306b\u5f53\u305f\u308b\u306e\u304c<span style=\"color: #ff0000;\"><strong>\u300c\u30c7\u30ea\u30b2\u30fc\u30c8\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u5236\u7d04<\/h2>\n<p>\u30c7\u30ea\u30b2\u30fc\u30c8\u304c\u5b9f\u884c\u3067\u304d\u308b\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u306f\u3001\u30c7\u30ea\u30b2\u30fc\u30c8\u3068\u540c\u3058\u30b7\u30b0\u30cd\u30c1\u30e3\uff08\u5f15\u6570\u306e\u6570\u3001\u30c7\u30fc\u30bf\u578b\u3001\u623b\u308a\u5024\uff09\u3092\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306b\u9650\u3089\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u30b7\u30b0\u30cd\u30c1\u30e3\u3055\u3048\u5408\u3063\u3066\u3044\u308c\u3070\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u3001\u30af\u30e9\u30b9\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u306a\u304f\u3066\u3082\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u30af\u30e9\u30b9\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408<\/strong><\/span>\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u69cb\u6587<\/h2>\n<h3>\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u5b9a\u7fa9<\/h3>\n<pre class=\"lang:default decode:true\">Delegate Sub\/Function \u30c7\u30ea\u30b2\u30fc\u30c8\u540d<\/pre>\n<h3>\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u767b\u9332<\/h3>\n<pre class=\"lang:default decode:true\">[\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50] \u5909\u6570\u540d As New \u5b9a\u7fa9\u3057\u305f\u30c7\u30ea\u30b2\u30fc\u30c8(AddressOf \u767b\u9332\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u540d)<\/pre>\n<p>\u30c7\u30ea\u30b2\u30fc\u30c8\u306f\u30c7\u30fc\u30bf\u578b\u306e\u4e00\u7a2e\u306a\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>As\u30ad\u30fc\u30ef\u30fc\u30c9<\/strong><\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<h3>\u547c\u3073\u51fa\u3057\u5148\uff08\u30c7\u30ea\u30b2\u30fc\u30c8\u3092\u547c\u3073\u51fa\u3059\u30b5\u30f3\u30d7\u30eb\uff09<\/h3>\n<pre class=\"lang:default decode:true \">Module Module1\r\n\r\n    Sub Main()\r\n        '\u4eba\u30af\u30e9\u30b9\u306e\u5ba3\u8a00\r\n        Dim human As New Human()\r\n        'callHuman\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u5ba3\u8a00\r\n        Dim callHuman As CallHuman\r\n\r\n        '\u30c7\u30ea\u30b2\u30fc\u30c8\u306bgetAge\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\r\n        callHuman = New CallHuman(AddressOf human.getAge)\r\n        callHuman(\"\u7530\u4e2d\", 23)\r\n\r\n        '\u30c7\u30ea\u30b2\u30fc\u30c8\u306bgetSintyo\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\r\n        callHuman = New CallHuman(AddressOf human.getSintyo)\r\n        callHuman(\"\u5c71\u7530\", 170)\r\n\r\n        Console.ReadLine()\r\n    End Sub\r\n\r\nEnd Module<\/pre>\n<h3>\u547c\u3073\u51fa\u3057\u5143\uff08\u30c7\u30ea\u30b2\u30fc\u30c8\u53ca\u3073\u3001\u30c7\u30ea\u30b2\u30fc\u30c8\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u308b\u30e1\u30bd\u30c3\u30c9\uff09<\/h3>\n<pre class=\"lang:default decode:true \">Delegate Sub CallHuman(ByVal x As String, ByVal y As Integer)\r\n\r\nPublic Class Human\r\n    '\u5e74\u9f62\u3092\u8868\u793a\u3059\u308b\r\n    Public Sub getAge(ByVal name As String, ByVal age As Integer)\r\n        Console.WriteLine(name + \"\u3055\u3093\u306e\u5e74\u9f62\u306f\" + age.ToString + \"\u3067\u3059\u3002\")\r\n    End Sub\r\n\r\n    '\u8eab\u9577\u3092\u8868\u793a\u3059\u308b\u3002\r\n    Public Sub getSintyo(ByVal name As String, ByVal sintyo As Integer)\r\n        Console.WriteLine(name + \"\u3055\u3093\u306e\u8eab\u9577\u306f\" + sintyo.ToString + \"\u3067\u3059\u3002\")\r\n    End Sub\r\n\r\nEnd Class<\/pre>\n<p>\u30c7\u30ea\u30b2\u30fc\u30c8\u3068\u3057\u3066\u3001\u767b\u9332\u3059\u308b\u305f\u3073\u306b\u5b9f\u884c\u7d50\u679c\u304c\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30eb\u30c1\u30ad\u30e3\u30b9\u30c8\u30c7\u30ea\u30b2\u30fc\u30c8<\/h2>\n<p>\u4e0a\u8a18\u4f8b\u3067\u306f\u3001\u4e00\u3064\u4e00\u3064\u30c7\u30ea\u30b2\u30fc\u30c8\u306b\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\u3057\u3066\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30de\u30eb\u30c1\u30ad\u30e3\u30b9\u30c8\u30c7\u30ea\u30b2\u30fc\u30c8\u300d<\/strong><\/span>\u3092\u4f7f\u3046\u3053\u3068\u3067\u8907\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u307e\u3068\u3081\u3066\u4e00\u6c17\u306b\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb<\/h3>\n<pre class=\"lang:default decode:true \">Module Module1\r\n\r\n    Sub Main()\r\n        '\u4eba\u30af\u30e9\u30b9\u306e\u5ba3\u8a00\r\n        Dim human As New Human()\r\n        'Calculate\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u5ba3\u8a00\r\n        Dim callHuman1 As CallHuman\r\n        Dim callHuman2 As CallHuman\r\n\r\n        '\u30c7\u30ea\u30b2\u30fc\u30c8\u306bgetAge\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\r\n        callHuman1 = New CallHuman(AddressOf human.getAge)\r\n        '\u30c7\u30ea\u30b2\u30fc\u30c8\u306bgetSintyo\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\r\n        callHuman2 = New CallHuman(AddressOf human.getSintyo)\r\n\r\n        '\u30de\u30eb\u30c1\u30ad\u30e3\u30b9\u30c8\u30c7\u30ea\u30b2\u30fc\u30c8\r\n        callHuman1 = System.Delegate.Combine(callHuman1, callHuman2)\r\n        callHuman1(\"\u7530\u4e2d\", 170)\r\n\r\n        Console.ReadLine()\r\n    End Sub\r\n\r\nEnd Module\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u30c7\u30ea\u30b2\u30fc\u30c8\u3068\u306f\uff1f \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u624b\u6cd5\u306e\u4e00\u3064\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u3092\u76f4\u63a5\u547c\u3073\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001\u8ab0\u304b\u306b\u4f9d\u983c\u3092\u3057\u3066\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002 \u3053\u306e\u8ab0\u304b\u306b\u5f53\u305f\u308b\u306e\u304c\u300c\u30c7\u30ea\u30b2\u30fc\u30c8\u300d\u306b\u306a\u308a\u307e\u3059\u3002 \u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u5236\u7d04 \u30c7\u30ea\u30b2\u30fc\u30c8\u304c\u5b9f\u884c\u3067\u304d\u308b\u30e1\u30bd\u30c3 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[158],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6328"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6328"}],"version-history":[{"count":12,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6328\/revisions"}],"predecessor-version":[{"id":20798,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6328\/revisions\/20798"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6328"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}