Form Definition
The Form Definition section defines the layout of the form, including fields and phrases. The following command pair defines the beginning and the ending of the Form Definition section.
$SCREEN FormName FormType
$END-SCR FormName FormType
FormName and FormType must be the same as those entered on the $FORM command. They are required for the $SCREEN command but not for the $END-SCR command.
Screen Length
The maximum screen length is 24 lines. If needed, you can configure a maximum of fewer than 24 lines in order to accommodate smaller terminal sizes. You define the number of lines in the SCRLINES parameter of the univ.cfg file, which is located in the %LAWDIR%\system directory. For more information on the univ.cfg file, see the Lawson Administration: Server Setup and Maintenance guide.
Phrases
A phrase is constant text. The form compiler (scrgen) stores phrases in a language file so you can translate the phrases and display the form text and data in other languages. scrgen stores only the words in the phrase; it does not store special characters, such as periods and hyphens. For more information on language translation, see the Lawson Administration: Translation guide.
Delimiters for Fields, Phrases, and Attributes
Special characters, or delimiters, define the beginning and ending of fields, phrases, and certain form attributes, such as underlining and highlighting. The form compiler converts these characters to terminal control characters so they occupy form display positions.
The following table shows the characters used to define fields, phrases, and attributes. Because the meaning of the following characters is fixed, you cannot use them as data values or constant values in the form layout.
Use | To | |
---|---|---|
Left Bracket | [ | Define the beginning of a left-justified input field or a command button field. |
Ampersand | & | Define the beginning of a right-justified input field. |
Single Quote | ' | Define the beginning of a protected field. |
Plus Sign | + |
Define the beginning of a protected input field that is hidden on the form. A hidden-protected field is usually used to hold key information for form data transfers. |
Exclamation Mark | ! |
Define the beginning of a hidden input field that is not protected. A hidden field defined with this character is used for entering data such as a password. |
Right Bracket | ] |
Define the end of an input field or a command button field. You can also use the left bracket ([), the ampersand (&), and the single quote (') to define the end of one field and the beginning of another field. |
Semicolon | ; |
Define the beginning and end of an output-only field. A semicolon cannot end one field and begin another at the same time; however, a colon (:) can. |
Pipe | | |
Define the beginning of a phrase, except when that phrase continues on another line. A phrase ends either at the next field delimiter, at the end of the form line, or 50 characters after it began. |
Caret | ^ |
Define the beginning of a phrase when that phrase continues on another line. This instructs scrgen to store the column of words as a phrase. A caret must have a pipe below (|) it. The last entry in a columnar phrase must begin with a pipe. In the following example, Account Number is a single phrase. Although Description and Amount are in a column, they are processed as separate phrases because they each begin with a pipe. |
|
||
Note: Column phrase must be
strictly defined. Each line segment of the phrase must be the same
length as all other phrase segments. If another phrase or column phrase
does not begin at the end of a line segment, you must add a right
bracket (]) to terminate the phrase
segment.
|
||
Colon | : |
Define the end of one output-only field and the beginning of another when used between two semicolons (;). If a colon is not between two semicolons, it displays as text. |
Question Mark | ? | Highlight the following field or text. Highlighting ends at the next field delimiter or at the end of the current line. |
Back Slash | \ | Underline the following field or text. Underlining ends at the next field delimiter or at the end of the current line. |
Field Size
The number of spaces between the beginning and ending of field delimiters determines the size of the field on the screen. The size of the field in the Form Definition section must match the size of the field in the Transaction Data section (with the exception of date and scrollable fields, in which case size of the field in the Form Definition section can be smaller). If the size of the field in the Transaction Data section is greater than the size of the field in the Form Definition section, the field will be scrollable. When the cursor is positioned in a scrollable field, as much as possible of the field’s value will show in the field. However, the entire value will appear in the message line. When the cursor is not positioned in the field and if the field’s value is too large to appear in the field, asterisks will appear in the field
Initial Field Value
To give a field an initial value, type the value between the field delimiters. Occasionally, hidden and protected fields contain zeroes and spaces. These values are important because they define initial values needed for form and program control.
Restrictions on Form Layout
-
The first two fields on a form must be the transaction code and the action, and they must be defined in that order. For more information, see Transaction Data Section.
-
A field cannot extend over more than one line. Fields must start and finish on the same line.
-
If you start a line with an asterisk (*), the form compiler treats that line as a comment, even when it appears between the $SCREEN and $END-SCR commands.
-
A form can have zero, one, or two detail areas.