Later Today: ASP.NET Tutorial 2: Introduction to C#

ASP.NET Tutorial 5: Conditionals 2 ( switch constructs )

This article explains the use of switch constructs. Switch constructs are a conditional, like if/else constructs discussed in the previous ASP.NET Tutorial 4. In all honesty, you won’t use switch blocks nearly as often as you will use if… but there are times when they just plain make more sense.

A switch block compares a single variable or value to any number of other values, and when it finds a match, it executes some code. What really makes switch blocks handy is that after it finds a match, it will keep checking conditions until you tell it to stop (by using the break keyword).

Continue Reading this Article >>

ASP.NET Tutorial 4: Conditionals ( if/else constructs )

This article will introduce you to conditionals in C#. Conditionals are a program’s decision-makers. They are used to evaluate and compare data, and then take different sets of actions based on the evaluations. It’s really not very different from the way humans make decisions. For instance, let’s say you’ve decided that you want go swimming… but only if it’s not too cold outside (because I live in sunny California, I’d consider anything 75 or under is “too cold”). If you can phrase a concept like that in English ("if it’s over 75 degrees outside, I’ll go swimming"), you can program it just as easily.

Hopefully by the end of this article you will be able to write some of the most basic conditionals in C#… if constructs. We’ll even cover some of the more fancy variations of if… including if else and if else if constructs.

Continue Reading this Article >>
RSS Twitter LinkedIn Facebook
Doing neato things with JavaScript, please wait...