EDIT procedure for fields in cluster?
Joe Boyle
atla38 at dsl.pipex.com
Tue Aug 9 06:26:03 CDT 2005
sometimes you need to use syntax as below in order to allow returning
through acceptable values,
procedure input fieldx
begin
if entrymode
then if 0.5 gt size(truncate(fieldtext))
then let fieldtext = "0"
end
and you could also have a silent field to the end of the cluster which would
contain an edit proc like that below, you will have to add a ' edit
silent_field' command to the end of your append/entry procedure though,
procedure edit silent_field
begin
if entrymode
then if field3 ..
then error "...
if changemode
then if field3 ..
then warn "...
if entrymode
then if field4 ..
then error "...
...
if entrymode
then if field5
...
End
or even as below if other processing can modify the fields in question
procedure edit silent_field
begin
edit field3
edit field4
End
Regards, Joe.
-----Original Message-----
From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
Murray Scholz
Sent: 09 August 2005 07:12
To: roger32909 at bellsouth.net
Cc: powerh-l at lists.sowder.com
Subject: Re: EDIT procedure for fields in cluster?
Have tried it here (vms and 710G1) , and seems to invoke edit procedure all
OK.. see this
little example, which works just fine for both fields
screen aaa
file parameters occurs 19 times
title " Lst-Used Lst-Used Extra" at 2,1
title " Key Number Num Date Numeric Description
Other-Info" at 3,1
draw 4,1 to 4,80
skip to 5
align (1,,4) (,,10) (,,20) (,,29) (,,42) (,,62)
cluster occurs with parameters
FIELD PARAM-KEY OF PARAMETERS
FIELD LAST-USED-NUM OF PARAMETERS
FIELD LAST-USED-NUM-DATE OF PARAMETERS
FIELD EXTRA-NUMERIC OF PARAMETERS
FIELD PARAM-DESCRIPT OF PARAMETERS for 1,19
FIELD OTHER-INFO OF PARAMETERS for 1,18
cluster
;-------------------------------------
procedure edit last-used-num of parameters
begin
if last-used-num of parameters = 0
then error "Cannot use ZERO..."
end
;-------------------------------------
procedure edit extra-numeric of parameters
begin
if extra-numeric of parameters = 0
then error "Cannot use ZERO..."
end
;--------------------------------------
build
Don't forget, that the edit procedure is only invoked if the user actually
enters some data
into the field (ie. if the just skip through the field, , probably leaving
the data-item with
value zero, then the edit procedure does NOT get invoked.)
There are a number of ways around this, eg. making the field required , or
even resorting to
something like...
procedure input fieldx
begin
if fieldtext = "" and fieldx = 0
then let fieldtext = "0"
end
which will force the processing into the edit procedure.
Regards
Murray Scholz
Agricultural Business Research Institute
University of New England
Armidale NSW 2351 Australia
Email murray.scholz at abri.une.edu.au
roger32909 at bellsouth.net wrote:
> PH 7.10G on OpenVMS.
> We have a screen with a cluster of some nine fields arrayed horizontally,
e.g.
>
> Field1 Field2 Field3, etc.
> 09
> 10
> 11
> 12
>
> We are trying to prevent entries of zero for date and quantity fields.
> However, it appears that an EDIT procedure only works for Field1. EDIT
procedures for subsequent fields appear to have no effect for one can easily
enter zero and continue. Of course, we can test for this in a PREUPDATE
procedure, but we would like to give immediate feedback to the user. Is
there something special that needs to be coded in EDIT procedures for fields
in a cluster without their own ID?
>
--
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request at lists.sowder.com
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
More information about the powerh-l
mailing list