The procedure does not have a dcl-pi because nothing is being passed into it. Should there always be one? I also changed nothing about the program besides this specific procedure beginning, so the Qty shouldn't change or have a value added to it (maybe besides Qty being global or not as you suggested). - Jon Paris
The workstation f-spec is just: Dcl-F HazShpF Workstn;
- Dave Clark
Alan, that seems like good practice, long story short I'm the guy that tried to convert the programs to free-format and the other guy was curious because in fixed format the standalone variables with the same names would show up on the display file.
Thanks for all the helpful information,
Jeffrey Young
----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, July 19, 2018 12:05 PM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Fixed v Free Display Variables
Whatever the problem it is highly unlikely (near impossible) for it to be a fixed/free issue. Under the covers the two are identical.
But you are obviously not showing all of your code because the dcl-proc should be followed by a dcl-pi and there isn't one there.
Variables within a subprocedure are local and therefore would not normally be available to display without copying it somewhere.
The fact that it has the same name in the subprocedure as it has on the file means you have _two_ versions of the field Qty in the program - one global (the file version) and one local (the GetHazmat version). The global version will always be the one used by any display file output (unless Data Structure I/O is used which is not th case here as Qty is a stand-alone.
All of which is to say that your fixed form version must have a value being placed in the global Qty field and you free version doesn't.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Jul 19, 2018, at 6:29 AM, jyoung@xxxxxxxxxxxxx wrote:
I have an interesting question. (very new dev here) Let's say my display file has a output field named Qty. In fixed format, the program declares a standalone variable Qty and sets the message. The display file shows the message when I run the program.
P GetHazmat B
D Qty S 40 Inz('G = Gallon, GP = 5 Gallon Pail')
However, if I try to do the same in free format, the message will not display. I assume because the Qty variable is being created again? But then why does it work fixed format? I know to solve the issue is just to not declare it again as a standalone in free format, but that doesn't solve my curiosity. Does anyone have some clarification?
Dcl-proc GetHazmat;
Dcl-S Qty Char(40) Inz('G = Gallon, GP = 5 Gallon Pail');
Thanks,
Jeffrey Young
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and
privileged information that is protected by law. The information
contained herein is transmitted for the sole use of the intended
recipient(s) and should "only" pertain to "WalzCraft" company matters.
If you are not the intended recipient or designated agent of the
recipient of such information, you are hereby notified that any use,
dissemination, copying or retention of this email or the information
contained herein is strictly prohibited and may subject you to
penalties under federal and/or state law. If you received this email
in error, please notify the sender immediately and permanently delete
this email. Thank You
WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<http://www.walzcraft.com> Phone: 1-800-237-1326
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You
WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<
http://www.walzcraft.com> Phone: 1-800-237-1326
As an Amazon Associate we earn from qualifying purchases.