Problem with data entry on form

"James B. Byrne via Aubit4gl-discuss" <[email protected]> Thu, 4 Feb 2021 10:51:28 -0500
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
This is from exercise 7 of Informix4GL by Example.  When I try to enter a value
in the unit price field then I get this error:

"You must enter a unit price. Please try again."

The program code where this happens is:

Program
####
GLOBALS
  DEFINE
          gr_stock  RECORD
            . . .
            unit_price        LIKE stock.unit_price
  END RECORD

. . .
      BEFORE FIELD unit_price
        IF gr_stock.unit_price IS NULL THEN
          LET gr_stock.unit_price = 0.00
        END IF

      AFTER FIELD unit_price
        IF gr_stock.unit_price IS NULL THEN
          ERROR "You must enter a unit price. Please try again."
          NEXT FIELD unit_price
        END IF
. . .

The form contains this:

Form:
####
SCREEN
{
. . .
  PRICING INFORMATION
               Unit: [f004]     Unit Price: [f005       ]

}

TABLES
  stock
  manufact

ATTRIBUTES
  . . .
  f004  = stock.unit, UPSHIFT;
  f005  = stock.unit_price;

There is not much going on here.  I cannot see why the value returned from the
screen is null?  Given that the value is set to a non-null value before the
field is displayed I do not understand how that is replaced by a null in any
case.

What am I missing?

-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
   Unencrypted messages have no legal claim to privacy
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:[email protected]
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3