Visual Basic Notes

Visual Basic Notes - Exit Statements-Exit dont ever...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Visual Basic 3/4/08 1.Sequence 2.Selection -If -Select Case 3.Iteration (repetition) (Looping) Do while true ______ ______ ______ Loop -Infinite possibilities x= 101 Do While x < 100 >Pretest ______ ______ ______ Loop None of the code will execute Dim strEntry as String str Entry = InputBox(“Please type in a score”) Do While CInt(strEntry) <> -1 'Enter/Calculate the score ______ ______ ______ strEntry = IntputBox(“ “) Loop Do until <Condition> dont need to use Inverse of do while You can use do not while <Condition> Loop Post test Loop- Do very rarely use _________ Loop while <Condition>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
For I = 0 to 10 Step 3 _______ _______ _______ Next -Will execute 11 times -indicates increments of I -loop would count 4 times till its over ten the the code isnt executed after that -if its increment of minus then you have to count in the opposite direction
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Exit Statements-Exit dont ever use-Exit for can be used for certain things-Exit Do - ?-Exit Function- essentially the same as Exit Sub-Exit Sub- good for validating bad dat and avoiding confusing nested loops If &lt;condition if we have bad data, text Box #1&gt; MessageBox.Show Reset Focus Exit Sub End If If &lt;Condition if we have bad data, Text Box #2&gt; MessageBox.Show Reset Focus Exit Sub End If 'Process data __________ __________ __________ End Sub -By using validators for bad data we get to the end to process data and dont have to nest together a ton of If then statements. Makes things much simpler. Exit sub pusheses out to the process data section that holds all my equation...
View Full Document

Page1 / 2

Visual Basic Notes - Exit Statements-Exit dont ever...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online