ITEC81 (Sir Rumer) Flashcards
are the statements that controls the execution of the program based on the specified condition
it is useful for determining whether a condition is true or not
Control statements
it is the simplest form of control statement, frequently used in decision making and changing the control flow of the program execution
if-then statement
can be followed by an optional Else statement, which executes when the Boolean expression is false
If-then-else statement
provides a choice to execute only one condition or statement from multiple statements
if-then-elseif statement
allows a variable to be tested for equality against a list of values.
select case
must evaluate to any of the elementary data type in VB.NET, boolean, byte, char, date, double etc
expression
list of expression clauses representing match values for expression
expressionlist
following case that run if the select expression matches any clause in expressionlist
statements
statements following Case Else that run if the select expression does not match any clause in the expressionlist of any of the Case statements.
elsestatements
is triggered automatically when the user selects a different item in the ComboBox
SelectedIndexChanged
are fundamental for tasks that require repetition, such as iterating through collections, processing data, or performing calculations multiple times
Looping Statements
determines whether the loop will continue or terminate
represented by a diamond-shaped box
condition
will execute repeatedly as long as the condition remains true
represented by a rectangular box
Conditional code
it repeats the enclosed block of statements while a boolean condition is true or until the condition becomes true.
it could be terminated at any time with the Exit Do statement
Do Loop
continues until the specified condition is true. This loop is useful when you want to execute code until a certain condition is met
Do until loop
executes as long as the specified condition is true. It’s useful when the number of iterations is not known beforehand. Similar to the While Loop, but it can also be structured yo ensure the code block executes at least once.
Do While Loop
This keeps the UI responsive during the loop
Application.DoEvents()
This pauses the loop for half a second, making the easier to see the updates
Thread.Sleep()
is used to execute a block of code a specific number of times. it’s particularly useful for iterating over a range of values or performing repetitive tasks.
For Next Loop
used to mark the end of a For…Next Loop. It indicates that the loop should continue or terminate based on the conditions defined in the loop
Next
is used to iterate over a collection or an array
this loops allows you to process each item in the collection without needing to manage the index manually, making it simple and cleaner for working with collections.
For Each… Next Loop
a variable that represents the current element in the collection during each iteration
item
the collection or array you want to iterate over
collection
is used to execute a blocks of code repeatedly as long as a specified condition is true.
it is useful when the number of iterations is not known beforehand and you want to continue executing the code until a certain condition changes
While End Whileloop
This is a boolean expression that is evaluated before each iteration of the loop. if it evaluates to true, the code inside the loop will execute. If it evaluates to false, the loop will terminate
condition
this is the section of code that will run as long as the condition is true.
code block
is used in conjuction with the With statement to simplify code that manipulates an object.
End with
allows you to execute a series of statements on a specified object without repeatedly referencing the object
with statement
this keyword introduces the block, specifying the object to work with
With
this is the instance of the class or object you are working on.
object
this keyword closes the block
End With
refer to placing one loop inside another. This structure allows you to perform complex iterations over data sets, such as multi-dimensional arrays or combinations of items.
Nested Loops