Rob: I set the pointer to the address of the field in the calling procedure:
FieldToCheck = %addr(filerec.PLCD);
Everything works when I set the length to 1A when the field is 1A. I want to be able to adjust the length according to the length of the field in the data file. For instance if the field length is 10 I want the length of
CheckField to be 10. On another call from a different procedure the length might be 25. I want my called procedure to adjust for different sizes. Hope this clarifies better what I'm trying to do.
******************************************
Don Wereschuk
ISD - Programmer/Analyst
Simcoe Parts Service Inc.
Phone: 705-435-7814 Ex: 302
Fax: 705-435-6746
mailto:dwereschuk@xxxxxxxxxxxxxxx
******************************************
"Save the Cheerleader - Save the world" - Hiro Nakamura
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Monday, January 21, 2008 2:10 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Passing Parameters
How are you setting that pointer value?
Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
Don Wereschuk <dwereschuk@xxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
01/21/2008 01:52 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Passing Parameters
Hi All: I am having a problem with passing parameters to a procedure
that I just can't seem to solve.
The following code is my procedure:
P FillArrayAll B
D FillArrayAll PI
D FieldToCheck *
D CheckValue 50A
D ArrayValue 50A
D*
DCheckField S 1A based(FieldToCheck) VARYING
D
D
D*************************************************************************
/FREE
COUNT = 1;
read input filerec;
dow CheckField < CheckValue;
read input filerec;
enddo;
dow not %eof(input) and
CheckField = CheckValue and
COUNT < 9999;
WrkSupp(COUNT) = ArrayValue;
COUNT += 1;
read input filerec;
enddo;
/END-FREE
P FillArrayAll E
CheckValue is pre-set.
CheckField is a value from a data file
If I define CheckField to be the same size as the field in the file I have
no problems. My problem is that I want to pass different fields from the
file at different times, each field
Having a different size. When I defined CheckField larger than the actual
length of the field I get an error (Length of variable is out of range).
All the help I've been able to find
Says that using VARYING should set the variable to the proper length but
this is not working. Can anyone see what I'm doing wrong here. Thanks in
advance for any help.
******************************************
Don Wereschuk
ISD - Programmer/Analyst
Simcoe Parts Service Inc.
Phone: 705-435-7814 Ex: 302
Fax: 705-435-6746
mailto:dwereschuk@xxxxxxxxxxxxxxx
******************************************
"Save the Cheerleader - Save the world" - Hiro Nakamura
________________________________
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.
--
This is the RPG programming on the AS400 / iSeries (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.
--
This is the RPG programming on the AS400 / iSeries (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.
As an Amazon Associate we earn from qualifying purchases.