'McIntyre If Statements Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim number, digits As Integer Dim myString As String number = 53 If number < 10 Then digits = 1 End If If digits = 1 Then myString = "One" Else : myString = "More than one" End If If number < 100 Then digits = 2 ElseIf number > 100 Then digits = 3 Else MessageBox.Show("No") End If End Sub End Class
Monday, January 31, 2011
Programming 2 /* If Statements */
An "If" statement in Visual Basic is a comparison statement that evaluates to true or false. If the statement evaluates to true, then the inner statements within the "If" block are executed. If the statement evaluates to false, then the compiler skips over the comparison statement and executes the following lines of code. "If" statements are common in all programming languages, and they are an essential part of creating web and desktop applications.
Subscribe to:
Post Comments (Atom)
Classes
Programming II
Advanced Relational Database
Blog Archive
-
▼
2011
(35)
-
▼
January
(19)
- Challenge me in Mini Putt!
- Advanced Relational Database /* Inner Join between...
- Programming 2 /* Case Statements */
- Programming 2 /* If Statements */
- How to draw a Cartoon Banana.
- Programming 2 /* Practice #1 - Acts and Facts */
- Programming 2 /* how to join a string to another s...
- Programming 2 /* how to convert an integer into a ...
- Advanced Relational Database /* Assignment 1 Frog ...
- Creating A Database in Microsoft SQL Server 1/24/11
- Converting a number variable into a string 1/24/11
- Variables in Visual Basic 1/24/11
- Advanced Relational Database /* Testing the creati...
- Advanced Relational Database /* Testing the creati...
- Advanced Relational Database /* Testing the creati...
- Advanced Relational Database /* Temp Tables and Ta...
- Programming 2 /* Repeatable Processing */ 1/19/11
- M&M
- Code
-
▼
January
(19)
No comments:
Post a Comment