I am not aware of a guide as such. The training course covers it in a fair depth. The PAS help file has numerous code snippets but in many cases you'll need to experiment with these to learn.
At a high level I can tell you the following:
- code is organised in procedures
- a procedure can call another with three different syntaxes; "Exe Procname", "Job Procname" or just "procname"
- A procedure executes commands sequentially just as if you entered them in the IDQL command line
- Conditional execution is not possible. There is no "if conditioned execute proc 1 else execute proc 2." However you can fudge this with control variables. So "execute &mycontrolvariable" will execute a procedure referenced in the control variable.
- The ASK statement allows you to build a user menu and take user input.
- I have written systems with several hundred procedures so you can use these basic building blocks to assemble quite complex applications.
- Sophisticated logic can be achieved by a three step process:
- embedding a control variable inside a procedure
- setting the value of the control variable inside a second of your procedures
- having the second procedure copy the first procedure to a third procedure with the RESOLVE keyword
- having the second procedure execute the third procedure