I think you might be calling the CreateFlexOrderHeader routine by passing it
the ord# field that is in the record format. Even though you specify
"Const" to prevent you from changing the "Locally" defined field in the sub
procedure, I think the field that is being passed is global and in the
record format that is being cleared. Since they occupy the same physical
memory location, both are cleared.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Robert Rogerson
Sent: Monday, December 19, 2011 11:06 AM
To: RPG programming on the IBM i / System i
Subject: Clear record format clearing parameter as well...
Hi all,
I have a subprocedure to create an order header record.
P CreateFlexOrderHeader...
P b
d CreateFlexOrderHeader...
d pi n
d p_FONumber like(ord#) const
d p_BatchIdRec likeds(batchIdRecTemplate)
const
* Local variables
/free
Clear foordhd;
.
.
.
/end-free
P CreateFlexOrderHeader...
P e
When I put the program in debug a break just before the CLEAR FOORDHD
statement the p_FONumber parameter (a new order number) and p_BatchIdRec
(a record used to build a new order record) both have (correct) values.
When I issue the Clear foordhd statement (foordhd is the record format in
the file which I am building a new record for) the value for po_FONumber
is being set to 0 while p_BatchIdRec remains unchanged.
Can someone tell me why p_FONumber being changed?
Thanks,
Robert Rogerson
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1890 / Virus Database: 2108/4690 - Release Date: 12/19/11
As an Amazon Associate we earn from qualifying purchases.