The following guidelines apply to whitespace:
Insert blank lines between lines of executable code to make code easier to read. For example, insert blank lines between segments of code (e.g., after the initialization of variables, before and after nested blocks, etc.).
Sections of code can be indented to enhance the format of the code (e.g., If/Else conditions).
Whitespace can consist of either <space> or <tab> characters.
Use whitespace around the assignment operator in set and type statements and around binary operators in expressions.
Commands must be followed by one space and an expression, or two spaces or end-of-line (if argumentless).
Commands followed by post-conditional arguments must be followed by a colon with no whitespace.
Argumentless commands (e.g., FOR, ELSE, IF QUIT) with one space will compile with a warning.
The following are whitespace independent:
Array subscripts
Command position on the line
Command, parameter, and subscript separator (,)
Formal and actual parameter expressions
Parentheses
Property and method references
Relational and Boolean operators (<>[]!&#*+-'=)
Example
type RecordDEP dep = Db.getRecord(“DEP”,”CID=:CID”)
type String TYPE = dep.type
type Number JOB = %ProcessID
type RecordTEST tmp
if 'Db.isDefined("TEST","JOB = :JOB, TYPE = :TYPE") do {
set tmp = Class.new("RecordTEST")
set tmp.job = %ProcessID
set tmp.type = dep.type
}
else set tmp = Db.getRecord("TEST","JOB=:JOB, TYPE=:TYPE")
set tmp.totbal = tmp.totbal + dep.bal
do tmp.save()
*CID must be defined prior to the getRecord statement.