Naming Conventions

Top  Previous  Next

Identifiers

An identifier is the 'name' of a constant, a procedure or a variable. It is case insensitive. It may include letters (A-Z, a-z), digits (0-9) and the following special characters: . ~ $ !. It must start with a letter, and cannot contain spaces.

For example:

 

 

dim a123 as integer ' A legal example

dim 123a as integer ' An illegal example

dim a.something as integer ' Can contain dots.

sub my_sub (ARG1 as integer, ARG2 as string) ' This is also legal

 

 

Platform Objects, their Properties and Methods

The name of an object is used as a prefix, followed by a dot, followed by the name of the property or the method you would like to access. For example:

 

 

ser.send ' Addressing the 'send' method of a 'ser' object.

x = ser.baudrate ' Assigning variable X with the value of the 'baudrate' of a 'ser' object

 

Events

Events are related to specific objects, just like properties and methods. However, events are named differently. The pattern is on_objectname_eventname. Such as on_door_open.

 

 

sub on_ser_data_arrival ' event names may contain more than one word after the object name.