### Naming Conventions

Suggestions for B4A & B4J Programming Language Naming Conventions
This list not complete as not all controls covered.
Scope
Global = g (gstrName)
Module-level = m (mlblName)
Local to procedure = None (dblName)
Pseudo Constants = CSTR (CSTRAPPNAME)
Constant and Variable Naming Conventions
Data type = Prefix (Example)
Boolean = bln (blnFound)
Byte = byt (bytRasterData)
Collection object = col (colWidgets)
Currency = cur (curRevenue)
Date (Time) = dtm (dtmStart)
Double = dbl (dblTolerance)
Error = err (errOrderNum)
Integer = int (intQuantity)
List = lst (lstColors)
Long = lng (lngDistance)
Object = obj (objCurrent)
Single = sng (sngAverage)
String = str (strFName)
User-defined type = udt (udtEmployee)
Variant = vnt (vntCheckSum)
Object Naming Conventions
3D Panel = pnl (pnlGroup)
Accordion = acc (accOptions)
ADO Data = ado (adoBiblio)
Animated button = ani (aniMailBox)
AsyncStreams = astm (astmChat)
Button = btn (btnOK)
Check box = chk (chkReadOnly)
CheckBox = chk (hkName)
Combo box, drop-down list box = cbo (cboEnglish)
ComboxBox = cbx (cbxName)
Command button = cmd (cmdExit)
Common dialog = dlg (dlgFileOpen)
Communications = com (comFax)
Control (used within procedures when the specific type is unknown) = ctr (ctrCurrent)
Data = dat (datBiblio)
Data combo = dbc (dbcAuthor)
Data grid = dgd (dgdTitles)
Data list = dbl (dblPublisher)
Data repeater = drp (drpLocation)
Data-bound combo box = dbcbo (dbcboLanguage)
Data-bound grid = dbgrd (dbgrdQueryResult)
Data-bound list box = dblst (dblstJobType)
Date picker = dtp (dtpPublished)
Directory list box = dir (dirSource)
Drive list box = drv (drvTarget)
File list box = fil (filSource)
Flat scroll bar = fsb (fsbMove)
Form = frm (frmMain)
Frame = fra (fraLanguage)
Gauge = gau (gauStatus)
Graph = gra (graRevenue)
Grid = grd (grdPrices)
Hierarchical flexgrid = flex (flexOrders)
Horizontal scroll bar = hsb (hsbVolume)
Image = img (imgIcon)
Image combo = imgcbo (imgcboProduct)
ImageList = ils (ilsAllIcons)
JavaObject = jo(joName)
Label = lbl (lblName)
Lightweight check box = lwchk (lwchkArchive)
Lightweight combo box = lwcbo (lwcboGerman)
Lightweight command button = lwcmd (lwcmdRemove)
Lightweight frame = lwfra (lwfraSaveOptions)
Lightweight horizontal scroll bar = lwhsb (lwhsbVolume)
Lightweight list box = lwlst (lwlstCostCenters)
Lightweight option button = lwopt (lwoptIncomeLevel)
Lightweight text box = lwtxt (lwoptStreet)
Lightweight vertical scroll bar = lwvsb (lwvsbYear)
Line = lin (linVertical)
List box = lst (lstPolicyCodes)
ListView = lvw (lvwHeadings)
MAPI message = mpm (mpmSentMessage)
MAPI session = mps (mpsSession)
MCI = mci (mciVideo)
Menu = mnu (mnuFileOpen)
Menubar = mnb( mbMain)
Month view = mvw (mvwPeriod)
MS Chart = ch (chSalesbyRegion)
MS Flex grid = msg (msgClients)
MS Tab = mst (mstFirst)
OLE container = ole (oleWorksheet)
Option button = opt (optGender)
Picture box = pic (picVGA)
Picture clip = clp (clpToolbar)
ProgressBar = prg (prgLoadFile)
Remote Data = rd (rdTitles)
RichTextBox = rtf (rtfReport)
ServerSocket = srv(srvChat)
Shape = shp (shpCircle)
Slider = sld (sldScale)
Socket = sck (sckChat)
Spin = spn (spnPages)
StatusBar = sta (staDateTime)
StringBuilder = sb (sbText)
SysInfo = sys (sysMonitor)
Tab Pane = tp (tpMain)
TabStrip = tab (tabOptions)
Text box = txt (txtLastName)
TextArea = txt (txtComment)
TextField = txt (txtFindText)
TextView = tvw (tvwCalendar)
Timer = tmr (tmrAlarm)
Toolbar = tlb (tlbActions)
TreeView = tre (treOrganization)
UpDown = upd (updDirection)
Vertical scroll bar = vsb (vsbRate)
Suggested Prefixes for Data Access Objects
Container = con (conReports)
Database = db (dbAccounts)
DBEngine = dbe (dbeJet)
Document = doc (docSalesReport)
Field = fld (fldAddress)
Group = grp (grpFinance)
Index = idx (idxAge)
Parameter = prm (prmJobCode)
QueryDef = qry (qrySalesByRegion)
Recordset = rec (recForecast)
Relation = rel (relEmployeeDept)
TableDef = tbd (tbdCustomers)
User = usr (usrNew)
Workspace = wsp (wspMine)
Suggested Prefixes for Menus
File Open = mnu (mnuFileOpen)
File Send Email = mnu (mnuFileSendEmail)
File Send Fax = mnu (mnuFileSendFax)
Format Character = mnu (mnuFormatCharacter)
Help Contents = mnu (mnuHelpContents)
Formatting Your Code
Region Copyright
' This file is part of the B4J Project
'
' This Source Code is subject to the terms of the Mozilla Public License,
' v. 2.0. If a copy of the MPL was Not distributed with this File, You can
' obtain one at http://mozilla.org/MPL/2.0/
'
' Copyright (C) 2014, Robert W.B. Linn, Pinneberg, Germany.
' Internet: , E-Mail:
' Read readme.txt for any latest information
'
End Region
Region Project Notes
' B4J Project to ...
End Region
Region Project ToDo
'(+) New, (*) Changed, (-) Removed
'(+)
'(*)
'(-)
End Region
`Sub Process_Globals
Dim CAPPTITLE As String = ""
Dim CAPPVERSION As String = "v20140123"
Dim CAPPCOPYRIGHT As String = "Copyright (c) 2014 by "
Dim CAPPLOG As Boolean = True ' Flag setting logging on / off
...
End Sub`
' Close the app
`Sub AppClose
MainForm.Close
End Sub`
' Init the app
`Sub AppInit
'
End Sub`
' Log with global flag to log or not
`Sub AppLog(s As String)
If CAPPLOG = True Then Log(s)
End Sub`
' Description one liner
' Parameter P1 ...
' Parameter P2 ...
' Returns ...
`Sub my(P1 As Int, P2 As String)
End Sub`

Changed: 2018-06-07 09:08, Category: Application Development, File: T6C160M1195.htm, ID: 1195