EDIT procedure for fields in cluster?

Murray Scholz murray.scholz at abri.une.edu.au
Tue Aug 9 01:11:48 CDT 2005


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?
> 




More information about the powerh-l mailing list