understanding how define affects field initialized from temporary
Lorry Litman
LLitman@exchange.hsc.mb.ca
Mon, 13 Dec 2004 12:13:04 -0600
I'm trying to figure some weird screen behaviour which I'm trying to
understand what is going on.
vms 7.2-2, ph 7.10.g1, rdb 7.0-1
here is the jist of the screen and what it is doing or not
run screen empscrn passing t_emp_no mode f
screen empscrn receiving t_emp_no
temp t_emp_no zu size 9 reset at startup
file empfile primary occ 12
item emp_no of empfile initial t_emp_no if entrymode
access via emp_no using t_emp_no orderby emp_dt desc,emp_cd
def d_rpt_flag char * 6 = "o" if emp_rpt_flag of empfile = "n" &
else "es" if emp_rpt_flag of empfile = "y" &
else "nknown" if emp_rpt_flag of empfile = "u" &
else ""
cluster occurs with empfile
field emp_cd
field emp_rpt_flag
field d_rpt_flag
cluster
explanation:
as you can see there is no field statement for emp_no
first time entering the screen (no records exist) entering a record or group
of records emp_no is written to the table.
entering the screen after that, it displays the existing emp_no records, we
then
action append, enter field info, save & return.
record is written to the table, however, when going back into the screen the
record just saved is not found because the emp_no is recorded as 0 instead
of the t_emp_no.
the strange part is, if I remove the define statement or just make the
define statement = anything as opposed to checking the value of the field
everything works fine.
question:
is it possible that the define does some sort of file or record retrieval
and thus causes emp_no of empfile to lose its original initialization from
t_emp_no? I'm trying to understand what is happening in the background.
Thanx
Lorry
This e-mail and/or any documents in this transmission is intended for the address(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.