QAB allows you to re-use many components of your program, potentially saving you a lot of time when it comes to modifying the system.
Procedures and procedure bodies may be shared between programs. Most of the time sharing procedures and procedure bodies will save you time because you when you want to make a change you will only need to make it once, and all the relevant rpograms will be updated. On the other hand, a change to a procedure to enhance one program may sometimes have an undesirable effect in another program which also uses it. If a procedure is shared, changes made anywhere in the tree structure below it will affect any other programs using that procedure.
When procedure bodies are shared, check the use of table processing, maps and local fields carefully. The precautions that you should take when sharing a procedure are the same as when moving procedures.
The recommended way of working with a shared procedure is to "tie" it to a library program. Changes to the procedure or the procedure body are normally made from within the library program; a warning message is issued if a user attempts to edit it from within any other program.
An alternative to sharing a procedure or procedure body is to copy it. The copy is no longer shared and so may be edited without having undesirable effects elsewhere. The disadvantage is that each copy must be maintained separately.
QAB allows you to re-use the same formula and condition several times within a procedure body. While this is often very useful you should probably not bother to share simple formulas (such as assigning 0 to initialise several fields in a row or something similar). Little will be gained because the QAB Compiler "folds" identical formulas and conditions in any case so your program will not be any bigger. One reason to avoid sharing formulas like this is that it might happen later on that one of the fields needs to be assigned to a different value. Careless editing of the formula night cause the other fields to be assigned the new value as well. You should probably confine sharing formulas and conditions when your business and program logic dictate that they are likely to remain the same in future.
There are various techniques you could use when editing formulas and conditions to avoid problems with sharing:
Sometimes the fact that you can only share formulas within a procedure may be annoying - you can use macros to effectively share complicated formulas across your system.
Maps (at least message maps) be used more than one in the same procedure or procedure body, and one map may be used by many procedures, so many of the same issues that arise with sharing formulas or procedure bodies can also arise with maps.
Once again, you can use the Search Facilities of QABUTIL to find all the places where a particular map is used.