Now that we know how to use variables, let’s see how you can control the flow of your application.
Demonstration
1. Click PROJECTS NEW > PROJECT > BASIC PROJECT > OK
2. Name your project, in this case FlowControl > OK
3. Clear out the code it generated and replace with:
Use:
Add:
Add:
4. Define a variable:
5. Add the following line to your code
6. Add the following line to your code
7. Add the following line to your code
8. Add the following line to your code
9. Add the following line to your code
10. Click on RUN (F5) and an info box should appear saying “Good morning” or “Good day” depending on your current time.
11. We can extend this, by adding: Else If (DateGetHour( CurrentDateTime()) < 18) Begin
12. Add the following line to your code:
13. Click on RUN (F5) and depending on what time it is for you, the info box will say: “Good Morning”, “Good afternoon” or “Good day”.