>From: mrh@panix.com (Michael Hoffman)
>Date: 1 May 1997 17:37:21 -0400
>X-Informix-List-Id: <news.37418>
>
>I have a form set up to accept dates. The definition of the fields are:
>
>f006 = formonly.start, required, reverse;
>f007 = formonly.end, required, reverse;
>
>When I am entering data into the Form, I can hit <ESC> to accept without ever
>entering these fields!!!!
>
>My understanding of "required" was that the user HAS TO ENTER some value into
>the field. Does the 'formonly' designation cause a problem here?
You don't given any platform or version information, which doesn't help.
However, given the code below running on Sun Sparc (Solaris 2.5.1) and
I4GL 6.05.UC1, then in the first INPUT statement, I have to enter values
in the two date fields (but not in the two CHAR fields, because there
is no required attribute), but in the second INPUT, I don't not have
to type anything (and it doesn't matter whether the TYPE DATE part of
the specifications is present or not).
--- kk.per ---
DATABASE FORMONLY
SCREEN
{
[f000]
[f006 ] [f007 ]
[f100]
}
END
ATTRIBUTES
f000 = FORMONLY.f000 TYPE CHAR;
f006 = FORMONLY.f006 {TYPE DATE}, REQUIRED;
f007 = FORMONLY.f007 {TYPE DATE}, REQUIRED;
f100 = FORMONLY.f100 TYPE CHAR;
END
--- kk.4gl ---
MAIN
DEFINE
s CHAR(4),
d1 DATE,
d2 DATE,
t CHAR(4)
OPEN FORM f_kk FROM "kk"
DISPLAY FORM f_kk
MESSAGE "FIRST INPUT"
INPUT s, d1, d2, t FROM FORMONLY.*
LET s = "AAAA"
LET d1 = "1/1/97"
LET d2 = "2/2/97"
LET t = "DDDD"
MESSAGE "SECOND INPUT"
INPUT s, d1, d2, t WITHOUT DEFAULTS FROM FORMONLY.*
CLOSE FORM f_kk
END MAIN
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>