HPlogo HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 4 Advanced Forms Design

LENGTH CHECK

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Used to specify the minimum length of a field value.

Syntax

MINLEN value ["message"]

Parameters

value

The value can be a field, constant, save field, or a numeric expression, or it may be an index retrieve operand within parentheses. Refer to "Statement Syntax" earlier in this section for details.

message

Specifies a custom error message.

Discussion

A value longer than the field cannot be entered because of the physical limit imposed by the unprotected field area. For this reason, maximum field length need never be specified as an edit check. You may, however, specify the minimum number of characters to be entered with the MINLEN statement.

The value specifies the minimum number of characters allowed in the field. Note that this length does not include leading and trailing blanks.

The system defined value $LENGTH may be specified. This value allows you to require that the field be filled. The advantage of $LENGTH rather than the current field length is that $LENGTH allows you to change the field length without changing the MINLEN specification. The $LENGTH constant is equal to the length of the field when the forms file is compiled.

Example

  1. For example, the minimum number of characters entered in a six-character field could be specified as:

    MINLEN 2

    If the user spaces over three characters, types in one nonblank character, and leaves the rest of the field blank, an error is diagnosed.

  2. In another example, MINLEN is used to specify that the field must be filled. The following statement forces the field to filled, leaving no leading or trailing blanks:

    MINLEN $LENGTH

    You can also use an indexed operand as follows:

    MINLEN (LEN OF F1,F2,F3,F4,F5)

LEN must contain an integer value between 1 and 5, and the current value of the fields F1 through F5 must be positive. The minimum length depends on the value of LEN and the respective values of F1 through F5.

Feedback to webmaster