Tip use constants to keep code readable
Read [BPC]BPCNUM=CUST_CODEIf fstat=0Write [ITM]If fstat=3...
Read [BPC]BPCNUM=CUST_CODEIf fstat=[V]CST_AOKWrite [ITM]If fstat=[V]CST_ADUPKEY...
Even if you are skilled in version 6, do you know what fstat=7
means?
With fstat=[V]CST_ARECTICKDEL
, you can remember that this status corresponds to the fact that the record with the right updtick is no longer present when a deletion is required.
If you are not an expert, you can also find the list of the most useful constant in the Developer Guide Constants document.
In several cases of internal functions, the engine returns a numeric status that is not always simple to remember. When dealing with choices input from a local menu (for example a combo box, an enumeration, a set of radio buttons, and so forth), numeric values starting from 1 are returned again, and can confuse the development partner as well as the code reader.
Using supervisor constants with a name starting with [V]CST_A must become a routine. All these constants are defined in the Developer Guide Constants document and their use provides the following benefits:
If you have application parameters that have constant values, do not hesitate creating them. You can create your own constants starting with [V]CST_ followed by any letter other than 'A' it is reserved for the supervisor.
To do this, use the Workbench reference Constants Dictionary document and create your own constants.