Constant naming retention Remarks Recommended constants are represented by uppercase letters. Example #define max_value 10
Variable naming conventions [scope] Typename
parameter
Scope
Optional. Name habits for marking the range of variables. For example, local variables use the "L" prefix that reminds you that they only act on the inside of the defined program. The proposed Scope expression is as follows:
Scope
description
Example
l
Local
Lncounter
p
Private (Default)
PNSTATUS
G
Public (global)
GNoldRecno
t
Parameter
TnRecno
Type
Labeling the habit of variable data type. The proposed Type prefix is as follows:
Type
description
Example
a
Array
Amonths
c
Character
Clastname
y
Currency
YcurrentValue
di
Date
DBIRTHDAY
t
Datetime
TLASTMODIFIED
b
Double
Bvalue
fly
Float
Finterest
l
Logical
LFLAG
n
Numeric
Ncounter
o
Object
OEMPLOYEE
U
Unknown
UReturnValue
Note
The prefix is not required, but this good program habit is recommended. Using the prefix does not specify the value of the variable - in Visual FoxPro, the prefix is only a naming habit. For example, increasing the prefix "C" does not specify that only character data can be stored in this variable, but it can be reminded that the variable is established as accepting character data.
Note that the Scope prefix is only recommended instead of it. In some cases, the range is not necessarily clear. For example, in the main program of a stand-alone application, there is no difference in the visible range of variables defined by public or private. Type prefix is always related to the sample program.
Object naming convention prefixname
Recommended object name prefixes are listed in the table below.
Prefix
Object
Example
chk
Checkbox
ChkReadonly
COL
COLLECTION
ColformObjects
CBO
ComboBox
Cboenglish
cmd
CommandButton
Cmdcancel
cmg
Commandgroup
cmgchoices
CNT
Container
CNTMOVERLIST
CTL
CONTROL
CTLFileList
CAD
CursoraDapter
Cadinventory
Custom
User-defined
DTE
DataENVIRONMENT
Dtesalesform
EDT
Editbox
EdttexTarea
FRM
FORM
FRMFileopen
FRS
Formset
FRSDataEntry
GRD
Grid
Grdprice
GRC
Column
Grccurrentprice
GRH
HEADER
Grhtotalinventory
HPL
Hyperlink
HPLHomeURL
IMG
Image
IMGICON
LBL
Label
lblhelpMessage
lin
Line
linVertical
LST
Listbox
LstpolicycoDes
OLB
OleboundControl
OlbObject1
Ole
Ole
OleObject1
OPT
Optionbutton
Optfrench
OPG
Optiongroup
Opgtype
PAG
Page
Pagdataupdate
PGF
Pageframe
PGFLEFT
PRJ
ProjectHOOK
Prjbuildall
Sep
Separator
Septoolsection1
SHP
Shape
SHPCIRCLE
SPN
Spinner
SpnValues
TXT
Textbox
TXTGETTEXT
TMR
Timer
TmraLarm
TBR
Toolbar
TbreditReport
XAD
XMLADAPTER
XADRemotexmldata
XFD
XMLField
Xfdprice
XTB
XMLTable
Xtbinventory
Remarks The prefix is not required, but this good program habit is recommended. Using the prefix does not specify the value of the variable - in Visual FoxPro, the prefix is only a naming habit. For example, increasing the prefix "CBO" does not specify an object is a combo box, but it can remind the object to be a combo box.
Table field named agreement Alias.Typename
parameter
Type
The data type of the tag table field. It is recommended that the prefix of Type is as follows.
Types of
description
Example
c
character
Customer.Clastname
di
date
Customer.dbirthday
t
Date time
Customer.tlastmod
b
Double precision
Customer.brate
fly
floating point
Customer.fvalue
G
Universal
Customer.gpicture
l
logic
Customer.lsellmail
M
Note
Customer.Mcomments
y
currency
Customer.YyeartDate
n
Numerical value
Customer.nitems
I
Integrity
Customer.icustID
Note
The prefix is not required, but this good program habit is recommended. Using the prefix does not specify the value of the variable - in Visual FoxPro, the prefix is only a naming habit. For example, increasing the prefix "C" does not specify that only character data can be stored in this variable, but it can be reminded that the variable is established as accepting character data.
Window naming agreement WNAME
Note
Do not use a prefix before class definition; only the prefix is used as an object.
Example
Use the following code when establishing a window object:
Define Window WcustomInvoices;
From nfirstrow, nfirstcolumn to nlastrow, nLastColumn