February 2019
Beginner
504 pages
10h 47m
English

In the previous chapter, we were presented with a problem. How can we make our report-generator script adapt to the privileges of the user running the script? The solution to this problem will require us to find a way to “change directions” within our script, based on the results of a test. In programming terms, we need the program to branch.
Let’s consider a simple example of logic expressed in pseudocode, a simulation of a computer language intended for human consumption.
X = 5
If X = 5, then:
Say “X equals 5.”
Otherwise:
Say “X is not equal to 5.”
This is an example of a branch. Based on the condition “Does ...
Read now
Unlock full access