Understanding Naming Conventions

This chapter discusses:

Click to jump to parent topicSource and Header File Names

Source and header file names can be a maximum of 8 characters and should be formatted as bxxyyyy, where:

Both the C source and the accompanying header file should have the same name.

This table shows examples of this naming convention:

System

System Code

Source Number

Source File

Header File

Address Book

01

10

b0100010.c

b0100010.h

Accounts Receivable

04

58

b0400058.c

b0400058.h

General Ledger

09

2457

b0902457.c

b0902457.h

Click to jump to parent topicFunction Names

An internal function can be a maximum of 42 characters and should be formatted as Ixxxxxx_a, where:

An example of a Function Name is I4100040_CompareDate

Note. Do not use an underscore after I.

Click to jump to parent topicVariable Names

Variables are storage places in a program and can contain numbers and strings. Variables are stored in the computer's memory. Variables are used with keywords and functions, such as char and MATH_NUMERIC, and must be declared at the beginning of the program.

A variable name can be up to 32 characters in length. Be as descriptive as possible and capitalize the first letter of each word.

You must use Hungarian prefix notation for all variable names, as shown in this table:

Prefix

Description

c

JCHAR

sz

NULL-terminated JCHAR string

z

ZCHAR

zz

NULL-terminated ZCHAR string

n

short

l

long

b

Boolean

mn

MATH_NUMERIC

jd

JDEDATE

lp

long pointer

i

integer

by

byte

ul

unsigned long (identifier)

us

unsigned Short

ds

data structures

h

handle

e

enumerated types

id

id long integer, JDE data type for returns

ut

JDEUTIME

sz

VARCHAR

Click to jump to top of pageClick to jump to parent topicExample: Hungarian Notation for Variable Names

These variable names use Hungarian notation:

JCHAR

cPaymentRecieved;

JCHAR [ ]

szCompanyNumber = _J(00000);

short

nLoopCounter;

long int

lTaxConstant;

BOOL

bIsDateValid;

MATH_NUMERIC

mnAddressNumber;

JDEDATE

jdGLDate;

LPMATH_NUMERIC

lpAddressNumber;

int

iCounter;

byte

byOffsetValue;

unsigned long

ulFunctionStatus;

D0500575A

dsInputParameters;

JDEDB_RESULT

idJDEDBResult;

Click to jump to parent topicBusiness Function Data Structure Names

The data structure for business function event rules and business functions should be formatted as DxxyyyyA, where:

An example of a Business Function Data Structure Name is D050575A.