PART 3: Decision/Statment
The If Statement
Decision is an important part in a program.Without a decision you basically can't do anything.
That's why it is one of the most important statement in a program,the If statement. With logic that If provides, your application can begin to analyze data and make decisions based on that analysis. For example, you make a checkbox and if the checkbox is checked then the program will continue.
If performs one of two possible code actions, depending on the result of the comparison. In other words, If uses comparison operator results to test data. If might execute one or more lines of subsequent code, depending on the result of a comparison.
Before If, the code you wrote executed sequentially, one statement after another. If lets your program be more decisive and execute only parts of the program if the data warrants partial execution.
NOTE:
You always need to do an if like this:
It is important to use then and end if.
The If Statement's Else
Whereas If executes code based on the comparison test's true condition, the Else statement executes code based on the comparison test's false condition. Else is an optional part of the If statement. Else specifies the code that executes if the comparison test is false
Example:
PS:
Checkbox1 was just an example.
Decision is an important part in a program.Without a decision you basically can't do anything.
That's why it is one of the most important statement in a program,the If statement. With logic that If provides, your application can begin to analyze data and make decisions based on that analysis. For example, you make a checkbox and if the checkbox is checked then the program will continue.
If performs one of two possible code actions, depending on the result of the comparison. In other words, If uses comparison operator results to test data. If might execute one or more lines of subsequent code, depending on the result of a comparison.
Before If, the code you wrote executed sequentially, one statement after another. If lets your program be more decisive and execute only parts of the program if the data warrants partial execution.
NOTE:
You always need to do an if like this:
Code:
if checkbox1.checked = true then 'what you want to do' End if
The If Statement's Else
Whereas If executes code based on the comparison test's true condition, the Else statement executes code based on the comparison test's false condition. Else is an optional part of the If statement. Else specifies the code that executes if the comparison test is false
Example:
Code:
if checkbox1.checked = true then 'what you want to do' Else 'what you want to do' End if
Checkbox1 was just an example.
any tips for that?



