Programming conventions – Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 144

Advertising
background image

A–B

J

Appendix

J–1

VBASIC Language Development Kit
Programming Conventions and Tips

The A-B VBASIC Application Library uses a common set of conventions for
naming of constants, variables, functions, and subroutines.

Upper and lower case are used within names for legibility.

Global constants, variables, functions, and subroutines begin with an upper
case letter.

Global variables and functions end with %, &, !, #, or $ when they are
integer, long integer, real, long real, or string.

Local variables always begin with a lower case letter.

All BASIC keywords and functions are in all UPPER case.

Labels are used VERY rarely. GOTO is avoided.

WHILE... WEND is not used. ON ERROR, ON TIMER, etc. are not used.

Indentation is 2 spaces for any bracketing statements such as FOR .. NEXT,
TYPE .. END TYPE, SUB .. END SUB, etc. SELECT statements attempt to
indent thelines of each case far enough to allow the case selector to be easily
notices.

ELSE is required on all SELECT Statements.

Programming Conventions

Advertising
This manual is related to the following products: