Required Entry
Pickering, John (NORBORD)
PICKERIJ@norbord.com
Thu, 16 Sep 1999 10:47:43 -0400
>If the situation is that the user finds data and then modifies it and you
want
>to force entry in any blank EXISTING field data you might want to modify
Frank's
>code slightly as follows:
>
>Procedure Input Field1
>Begin
> If 0=size(fieldtext) and oldvalue(field1) = ' ' ; <-- or NULL
> then error 'Field1 is a required field'
> End
>
But the problem with this is that the space bar is perfectly acceptable
input! Unless you have a values clause on the field statement.
On fields which may or may not have existing values but which you want to
edit again (thereby forcing the user to complete the missing ones) I prefer
something like the following procedure code accompanied by accept verbs.
Note that character items (e.g. fieldx) are easier than numeric items (e.g.
fieldn).
procedure input fieldx of filex
begin
if 0 = size(tru(fieldtext))
then let fieldtext = fieldx of filex
if 0 = size(tru(fieldtext))
then error "blanks not allowed"
end
procedure input fieldn of filex
begin
if 0 = size(tru(fieldtext))
then let fieldtext = ascii(fieldn of filex)
; this will be messier if a decimal point is required
end
procedure edit fieldn of filex
begin
if 0 = fieldn of filex
then error "zero not allowed"
end
Regards,
John Pickering
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.