INCOMPLETE (return empty REQ control)

Top  Previous  Next

 

INCOMPLETE( )

The INCOMPLETE procedure returns the field number of the first control with the REQ attribute in the currently active window that has been left zero or blank, and gives input focus to that control. If all REQ controls in the window contain data, INCOMPLETE returns zero (0) and leaves input focus on the control that already had it.

The INCOMPLETE procedure duplicates the action performed by the REQ attribute on a BUTTON control. You must remove the REQ attribute from the button for the INCOMPLETE() code to run, otherwise RTL will select the first REQ field and the EVENT:Accepted will not occur.

Return Data Type:

SIGNED

Example:

CODE

OPEN(Window)

ACCEPT

 CASE ACCEPTED()

 OF ?OkButton

  IF ~Check1 AND ~Check2 AND ~Check3

   Message('You must check at least one box')

   CYCLE

  END

  ReqFld = INCOMPLETE()                   !Any REQ fields empty?

  IF ReqFld

   ReqFld{Prop:FillColor}=Color:Yellow    !color the bad field

   MESSAGE('The selected entry must be filled in.')

   CYCLE

  ELSE

   BREAK                                  !If not, go on

  END

 END

END

See Also:

REQ

BUTTON