Style Tips 

Topic Date /
Examples /
Link to comments
2 Keep the scripts self-documenting This does not mean putting comments on each and every statement. On the contrary, the code itself should be understandable and self-explanatory without comments wherever possible. For example the line

del F[Distribution list number]

does not need the comment “Delete  Distribution list number”. But in cases involving technical names 

del F[S004-DLISN]

it is reasonable to add the comment. And in cases involving absolute coordinates (avoid them if possible), it is a must to add a comment:

del #[12,74]   // Delete  Distribution list number

Often it makes sense to add a comment about why we are doing something. This typically precedes a block of code:

// Delete the fields that we moved to the main screen
del [Distribution list number]
del [Business are code]
del [Distribution list number]

// Disable input for critical fields if user is not authorized
if not Q[Role=SALES012]
   NoInput  [Amount]
   NoInput [Price]

In this way you can structure your script, grouping related statements together. Put a blank line before each logical group, but only one line.

Last update: July 4, 2004

Keep the scripts self-documenting