Friday, June 20, 2014

Naming Conventions


This tutorial is written explicitly for LiveCode 6.6.2 Stable and might not work with other versions. The tutorial will not be updated!


LiveCode does currently not have anything like a namespace as found in in C or PHP. There are two different ways how you can handle this.

Possibility 1

ee = first and last letter of company name

Player = what the substack does

Example: eePlayerStart, eePlayerStop, eeDbGet, eeDbInsert

Possibility 2

Since a few month I've started with a new naming convention with dots.

ee = first and last letter of company name

player = what the stack/library does

playVideo = method name


  • ee.player.playVideo
  • ee.sql.insert
  • ee.couchdb.createDocument

This naming convention does not clash with the Livecode engine. I've asked my Account Manager at Livecode and got positive feedback by the core team.


Variable Prefixes

The variable prefixes have been defined as best practice in the comprehensive manual that comes with LiveCode which you can find within the install directory.

Prefix Variable Type Example
g Global Variable gMyVar
s Script Local Variable sMyVar
t Handler Local Variable tMyVar
p Parameter pMyVar
k Constant KMYVAR

Tool Prefixes

These are my personal prefixes for the tool names.
Prefix Variable Type Example
btn Button btnSave
lbl Label lblName
fld Text Field fldName
chb Check Box chbName
cob Combo Box cobName
rdb Radio Button rdbName
lst Scrolling List lstName
mnu Option Menu mnuName
tab Tab Panel tabName
img Image Area imgName
tbl Basic Table tblName
dg DataGrid dgName

LiveCode and OOP

With some small scripts you can turn your way of writing applications in LiveCode in to full OOP (object oriented programing).

This article explains the details.

No comments:

Post a Comment