﻿
{"id":105,"date":"2012-03-09T20:10:35","date_gmt":"2012-03-09T20:10:35","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=105"},"modified":"2012-05-28T13:16:47","modified_gmt":"2012-05-28T13:16:47","slug":"cta-breakcontinuereturn-komutlari","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/cta-breakcontinuereturn-komutlari\/","title":{"rendered":"C# Break,Continue,Return Komutlar\u0131"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Bazen yazsakta baz\u0131 komutlar\u0131n okunmamas\u0131n\u0131 isteriz,bazen d\u00f6ng\u00fcy\u00fc 100 e kadar sayd\u0131r\u0131r ama yar\u0131s\u0131nda durmas\u0131n\u0131 isteriz.Bazende o metoddan arkam\u0131za bakmadan \u00e7\u0131k\u0131p gitmek isteriz.\u0130\u015fte bu durumlarda break,continue ve return komutlar\u0131 imdad\u0131m\u0131za yeti\u015fecektir&#8230; \ud83d\ude0e<br \/>\n<!--more--><strong><span style=\"color: #ff0000;\">Break<\/span><\/strong> komutu;<br \/>\nBu komut ko\u015fullar\u0131 bilenlere pekte yabanc\u0131 gelmeyecektir.Switch Case ko\u015ful yap\u0131lar\u0131nda kulland\u0131\u011f\u0131m\u0131z bir ifadedir.Hemen \u00f6rnek verelimde an\u0131msay\u0131n\u0131z;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nswitch (De\u011fi\u015fken)\r\n            {\r\n               case buysa:\r\n                    Bu olsun;\r\n                    break;\r\n                case Yok efendim bu ise:\r\n                    Bu olsun;\r\n                    break;\r\n            }\r\n<\/pre>\n<p>Break,genel anlamda d\u00f6ng\u00fc ya da switch ko\u015fulunun scope&#8217;u d\u0131\u015f\u0131na \u00e7\u0131kmam\u0131z\u0131 sa\u011flar.Yukar\u0131da da g\u00f6rd\u00fc\u011f\u00fcn\u00fcz gibi de\u011fi\u015fken case yap\u0131lar\u0131yla kontrol edildikten sonra do\u011fru olan kodlar \u00e7al\u0131\u015ft\u0131r\u0131lacakt\u0131r.Di\u011fer caseler kontrol edilmemesi i\u00e7in break komutuyla switch in scopelar\u0131ndan \u00e7\u0131k\u0131lacakt\u0131r.<\/p>\n<p><strong><span style=\"color: #000080;\">Dikkat!<\/span><\/strong>:<br \/>\nBreak komutu d\u00f6ng\u00fc bloglar\u0131 ve switch kontrol\u00fcnden ba\u015fka yerde kullanamay\u0131z.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nfor (int i = 1; i &lt;= 5; i++)\r\n            {\r\n                if (i==3)\r\n                {\r\n                    break;\r\n                }\r\n                Console.Write(i);\r\n            }\r\n}\r\n\/*i \u00fc\u00e7 oldu\u011funda d\u00f6ng\u00fcden \u00e7\u0131kt\u0131\u011f\u0131 i\u00e7in\r\nsaymaya devam etmeyecektir.\u00c7\u0131kt\u0131 olarak &quot;12&quot; g\u00f6sterecektir.*\/\r\n<\/pre>\n<p><strong><span style=\"color: #ff0000;\">Continue<\/span><\/strong> komutu;<br \/>\nBu komuttan sonra yaz\u0131lan komutlar \u00e7al\u0131\u015ft\u0131r\u0131lmaz.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nfor (int i = 1; i &gt;= 5; i++)\r\n             {\r\n                if (i &lt; 3)\r\n                {\r\n                    continue;\r\n                }\r\n                Console.Write(i);\r\n            }\r\n            Console.Read();\r\n\/*i 3 ten k\u00fc\u00e7\u00fck oldu\u011fu s\u00fcrece continue den sonraki\r\nifadeler okunmayacakt\u0131r.i 3 e e\u015fit ve b\u00fcy\u00fck oldu\u011fu\r\ns\u00fcrece,continueden sonraki ifadelerde okunacakt\u0131r.\r\nEkrana 345 olarak yaz\u0131lacakt\u0131r.*\/\r\n<\/pre>\n<p><strong><span style=\"color: #000080;\">Dikkat!<\/span><\/strong>:<br \/>\ncontinue komutu,break komutu gibi d\u00f6ng\u00fclerden ba\u015fka yerlerde kullan\u0131lm\u0131yor.<br \/>\n<span style=\"color: #ff0000;\"><strong>Return<\/strong><\/span> komutu;<br \/>\nBu komut sayesinde metodlardan \u00e7\u0131kabiliyoruz.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Bazen yazsakta baz\u0131 komutlar\u0131n okunmamas\u0131n\u0131 isteriz,bazen d\u00f6ng\u00fcy\u00fc 100 e kadar sayd\u0131r\u0131r ama yar\u0131s\u0131nda durmas\u0131n\u0131 isteriz.Bazende o metoddan arkam\u0131za bakmadan \u00e7\u0131k\u0131p gitmek isteriz.\u0130\u015fte bu durumlarda break,continue ve return komutlar\u0131 imdad\u0131m\u0131za yeti\u015fecektir&#8230; \ud83d\ude0e<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[54,55,56],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-c-sharp-c","tag-break","tag-continue","tag-return"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}