Language structure (sequential structure, conditional choice structure and cyclic structure) is the core of the process programming language, however, because these three kinds of programming structure are in line with human thinking, so it is fully supported and applied in the language of object-oriented programming. It can be said that the implementation of any function, are inseparable from these three kinds of programming structure. Here is a study of the language structure of the conditions of the specific use of the structure.
Method/Step
First, let's take a look at the two forms of conditional choice structure in an easy language. In order to illustrate the problem, the small compilation has made a comparison diagram as shown in the figure.
According to the comparison, we can get two rule:
1. " If a conditional statement executes the next statement immediately after the condition is judged to be true.
2. " Executes the statement at the flow line if the true conditional statement only has a condition that is true.
The following small series is an example to explain the specific use of conditional selection structure:
Create a Windows window program and draw a human-computer interface, as shown in the figure.
Next, add a "clicked" Event for the button component.
In the Assembly window, enter the "if" code as shown in the figure and tap the "Run" button.
You can test the effect.
Now let's Test the "If True" code: