Naming conventions for variables

Variables have mixed-case names with a lowercase first letter. The first letter of each internal word is capitalized.

Variable must be declared immediately before the variable is used. Thus code amendments will not break changes into two blocks of the added code (new variables declaration and new variables using).

Suffix with model acronym should remain in variable name.

Example:


InventTable           inventTable;
InventTable           inventTableLocal;
EcoResProductCategory ecoResProductCategory;
EcoResProductType_PRJ ecoResProductType_PRJ;

Variable type

Type of the variable should be used with same casing as defined.

true, false, and null are all lowercase.

Primitive types (like str, date, int, real, void, boolean) have lowercase names.

Example (incorrect):

Purchtable – NOOOO
purchTable.VENDAccount – NO

Example (correct):

ItemId  itemId;
int     i, k;
PurchTable purchTable;
purchTable = PurchTable::find('PO0123', true);
purchTable.VendGroup = 'SVC';

Table-variable used for record updation

When using of table-variable especially for updating data record, use Upd suffix.

Example:

InventTable inventTable;
InventTable inventTableUpd;

Temporary tables

Declaration of variable of temporary table type should be same, as table name.

Example:

TmpBankImport_RU tmpBankImport_RU;
TmpBudgetBalance tmpBudgetBalance;

Temporary table from persistent table

Use suffix Tmp

Example:

InventTable inventTableTmp;
EcoResProductType_PRJ ecoResProductType_PRJ;

inventTableTmp.setTmp();
inventTableTmp.ItemId = itemId;

ecoResProductType_PRJTmp.setTmp();
ecoResProductType_PRJTmp.checkProductType();

RunBase extensions

Use prefix dialog for naming variable of dialog form controls (using DialogField class).
Use prefix dialogGroup for naming variable of dialog form controls (using DialogGroup class)

Example:

ItemGroupId itemGroupId;
DialogField dialogItemGroupId;

DialogGroup itemGroup;

Global variables

Variable declared in class declaration of parent class or form, should be used with exact cases as declared.

See also

lowCamelCase