Module 2 - Using Variables
There are three main commands where variables are used:
- TEXT
- PARAGRAPH
- LOOP
Using Variables with TEXT / PARAGRAPH
TEXT and PARAGRAPH are, of course, more or less the same thing, they just are rendered differently. Here, the variable is simply used to write a piece of text into your report that you don't know beforehand. For example, if your report was listing a Brother's talks for the coming month, then a variable you would need would be to enter the Brother's name so that you could generate a report for each Brother in your congregation. In which case, you might wish to have the report start with "Dear XXX". The XXX is where the variable would come into play.
Using Variables With LOOP
Since a LOOP command in itself does not print anything out, it is clear that the variable has a different role to play here. Do you remember trying to extract brothers by using CURRENT."BrotherName" to ensure it extracted the brother as given by the outer loop? Well, if you used a variable to say which brother instead of whatever the outer row gave us, then we could extract all data for the brother you specify, instead.
This may not make a lot of sense right now, so bear with us. We will come to some real-world examples shortly.