Summary

Completed

In this module, you learned about basic AL statements. You also learned that, to help explain your code to others, you can enter comments in your code by entering them line-by-line or by using a block comment.

The compound statement is used if you want to group multiple statements with one begin and end block. The compound statement is then considered one single statement. You can use a compound statement in an if statement because an if statement can only run one statement.

The if statement is one example of a conditional statement. The other conditional statement is called a case statement, where you can specify multiple possible values to check for. If the statement matches a value, it will run those statements.

Finally, you discovered the different repetitive statements. With the for statement, you need to know in advance how many times you'll loop. The while statement first checks its condition before running commands, and the repeat until statement will always run the statement(s) at least once before checking the condition.