4.3 Application Definition Conventions

The following are some of the best practice rules to follow when creating an Application Definition. These rules make reading the Application Definition easier and also help if you need to make modifications in the future.

This section contains the following information:

4.3.1 Symbols Used

Table 4-2 Description of Symbols

Symbol

Description

< >

Angle brackets represent an item.

For example, text, variable, or value.

[ ]

Square brackets represent an optional item.

If an item is not marked with square brackets, it is a compulsory item.

 

Indicates a line break.

4.3.2 Capitalization

Use capitalization where applicable.

Table 4-3 Capitalization

Instead of...

Use...

messagebox "some text" -yesno ?result

MessageBox "Some text" -YesNo ?Result.

4.3.3 Comments

Use comments throughout to explain what each section does and how it does it.

Table 4-4 Comments

Instead of...

Use...

Dialog Class #32770 Title"Log on"EndDialog

# Written By: B. Smith 07/Jun/2002# Last Modified By: C. Silvagni 13/Mar/2003# Logon Dialog BoxDialog Class #32770 Title "Log on"EndDialog

4.3.4 Switches

Switches are placed directly after the command, for example, Type -Raw, If -Text.

Table 4-5 Switches

Instead of...

Use...

Type $Username -Raw

Type -Raw $Username

4.3.5 Variables

All variable names start with a capital letter.

Table 4-6 Variables

Instead of...

Use...

Type $username

Type $Username

4.3.6 Indent Sections

Indent sections between pairs of commands, for example Dialog, Repeat, If.

An indent of three spaces is recommended.

Table 4-7 Indent Sections

Instead of...

Use...

If -Text "Some text"#Do thisElse#Do ThisEndIf

If -Text "Some text" #Do thisElse #Do thisEndIf

4.3.7 Blank Line Between Sections

Leave a blank line between sections, for example, between the Dialog Block and the rest of the Application Definition.

Table 4-8 Blank Line Between Sections

Instead of...

Use...

# Log on Dialog BoxDialog Class #32770 Title "Log on"EndDialogType $Username #1001Type $Password #1002Click #1

# Logon Dialog BoxDialog Class #32770 Title "Log on"EndDialogType $Username #1001Type $Password #1002Click #1

Write Subroutine Sections

Write subroutine sections at the bottom of the Application Definition and not half way through.

The name of the subroutine should describe its function. Do not use a numeric name. The name should follow the capitalization rule.

Wherever possible, use the Include command to create generic Application Definitions for frequently used elements, for example password change procedures. For common processes within the same Application Definition, use Subroutines.

4.3.8 Quotation Marks

Always use quotation marks around segments of text in commands.

Table 4-9 Enter Table Title Here

Instead of...

Use...

Type TextOrIf -Text Login

Type "Text"OrIf -Text "Log on"

4.3.9 Password Policy Names

Password policy names should represent the program they are used for. Do not use numerical names.

Table 4-10 Password Policy Names

Instead of...

Use...

PasswordPolicy3

GroupwisePasswordPolicy

At the top of the Application Definition enter and comment out information, for example, the author and the date of the last modification.

Table 4-11 Example

Instead of...

Use...

Dialog Class #32770 Title "Log on"EndDialog

# Written By: B. Smith 07/Jun/2002# Last Modified By: C. Silvagni 13/Mar/2003# Logon Dialog BoxDialog Class #32770 Title "Log on"EndDialog

NOTE:Always place the Title command after all other commands in the Dialog block.