BISD 5
logical operator
And -all conditions must be true Or- one condition must be true Not- Negates a condition Xor - When one condition in the compound condition is true, but not both, AndAlso - As soon as a condition is found to be false, no further conditions are tested and the compound condition is false OrElse- As soon as a condition is found to be false, no further conditions are tested and the compound condition is false
Nested If Statements
If statement within another one, the inner If statement If if else end if else if esle end if end if
code snippets
IntelliSense Each snippet consists of a complete programming task such as an If ... Then ... Else decision structure, sending an email message, or drawing a circle. You may find that modifying a complicated code snippet is more work than using IntelliSense to enter the statement.
If ... Then statement means a condition is tested
Is one value equal to another value? Is one value not equal to another value? Is one value greater than another value? Is one value less than another value? Is one value greater than or equal to another value? Is one value less than or equal to another value?
Show
MessageBox.Show MsgBox
errors
MsgBoxStyle.OKOnly 0 MsgBoxStyle.OKCancel 1 MsgBoxStyle.AbortRetryIgnore 2 MsgBoxStyle.YesNoCancel 3 MsgBoxStyle.YesNo 4 MsgBoxStyle.RetryCancel 5
Groupbox Vs Panel
Option GroupBox Object Panel Object Have a caption Yes No Have scroll bars Yes No Display a labeled border Yes No
If ... Then ... Else statement
To execute one set of instructions if a condition is true and another set of instructions if the condition is false If statement is true, the statement(s) between the Then keyword and the Else keyword will be executed. If the condition tested is false, the statement(s) between the Else keyword and the End If keywords will be executed. A condition cannot be true and false at the same time considered a block of code
block of code
Variables can be declared within the block of code, but they can be referenced only within the block of code where they are declared. fall out of scope (cannot be referenced) outside that block of code.
compound condition
When more than one condition is included in an If ... Then ... Else statement
Other Nested If Configurations
after the first condition has been tested, one or more statements can be executed prior to executing the inner If statement.
RadioButton objects
allow the user to make choices RadioButton objects are contained in a group box, the user can select only one radio button. rad False (unselected) to True (selected). If ... Then ... ElseIf statement -check multiple radio buttons because once the checked radio button is detected
And logical operator
allows you to combine two or more conditions into a compound condition that can be tested with an If statement.
Not logical operator
allows you to state conditions that are best expressed in a negative way. operator reverses the logical value of a condition on which it operates
CheckBox objects
are used with lists of options in which the user may select any number of choices. more than 1
Order of Operations for If Then
arithmetic operators relational operators logical operators Logic Operators Order Not And, AndAlso Or, OrElse, Xor
Checked property
can be tested in an If statement to determine if the RadioButton object has been selected.
IsNumeric function
can check the input value to determine if it can be converted into a numeric value such as an Integer or Decimal data type. If so, it returns a True Boolean value. If the value is not recognized as a numeric value, the IsNumeric function returns a False Boolean value.
string value comparison
compares each character in two strings, starting with the first character in each string.
message box (dialog box)
displayed during execution with a variety of arguments can display a message and a caption in the title bar (two arguments with two commas between the arguments). message shown in the parentheses will appear in the message box when the code is executed. MsgBoc("Message", Button Entry, "error")
"garbage in, garbage out"
fact that allowing incorrect input data into a program produces incorrect output. users will enter invalid data.
Panel object
has a black dashed border that does not appear when the application is executed
decision structure
is one of the three fundamental control structures used in computer programming.
Or logical operator
is used to connect two or more conditions, the compound condition is true if any tested condition is true.
GroupBox
object associates items as a group, allowing the user to select one item from the group. caption text GroupBox object groups the radio buttons for selecting the decking type grp Grouping all options in a GroupBox object gives the user a logical visual cue.
If ... Then ... ElseIf statement
problem in which multiple conditions must be tested any remaining conditions are not tested after a condition is found to be true
message box icon
represents the MsgBoxStyle that can be displayed as a graphic icon in the message box. add values to display both the buttons and a picture icon
condition
the statement that tests the radio button statements that are executed when a condition is true or false
Select Case statement
the value in a single field, such as the day number, is evaluated. Based on the value in the field, a distinct action is taken. The End Select statement is required to end value of any data type can be used in the test expression. relational operators in a Select Case statement, but you must use the keyword Is with the relational operator. Case Is > Ranges TO or commas Case 1 To 3 Case 1, 3 Select Case Case 1 Case 2 End Select Select Case statement is most useful when more than two or three values must be tested for a given variable. If ... Then ... ElseIf statement is more flexible because more than one variable can be used in the comparison.
If ... Then statement
true, the statement(s) between the If and the End If keywords will be executed. condition is not true, no statements between the If and End If keywords will be executed, and program execution will continue with the statement(s) after the End If statement. If and Then on the same programming line. End If statement, which terminates the decision structure, also should be on a line by itself.
Trailing Else Statements
variable does not meet the conditions stated in the previous If statements.