|
Then I still have to use the For loop for filling.
Had a brainstorm and tried this:
Subst(DelimFill:1:%Len(DelimFill)) = efdFldDelim;
which only put in a single semicolon. Then I tried:
%Subst(DelimFill:*All) = efdFldDelim;
which passed the syntax check in RDi, but not the "compiler" check. :)
On Mon, Mar 21, 2016 at 2:27 PM, Michael Schutte <mschutte369@xxxxxxxxx>
wrote:
If you still have it defined as an array, you couldsomething
MyArray(*) = efdFldDelim;
Or initialize all array elements to that value.
On Mon, Mar 21, 2016 at 1:46 PM, Jeff Crosby <jlcrosby@xxxxxxxxxxxxxxxx>
wrote:
A couple of weeks ago, I asked about concatenating an entire array to arpg400-l@xxxxxxxxxxxxxxxx>
string. Scott Klement had a better idea which was this:
<quote>
On Sun, Mar 13, 2016 at 6:07 AM, Scott Klement <
wrote:
Jeff said one thing that puzzles me. He said it's always filled with
semicolons... That's weird. Why would you use an array for
easier?like that? Just do this:
string = *all';';
now the string is filled with all semicolons. isn't that a lot
with athat
</quote>
to which I responded:
<quote>
Yes it is, and I like it.
This is for a new application where I need to create a number of files
will be FTP'ed offsite. Each file has a variable number of fields
detailsemicolon as the field separator.totals,
Each file has, as the last record, a BATCHCONTROL record with file
I need to put a variable number of semicolons at the end of this batch
control record so this record has the same number of fields as the
programrecords in the file. I want to use the exact same logic in each
datethat builds a file and, for some reason, got fixated on using an arrayand
just setting the DIM of the array to the number of semicolons I need.But
it's even simpler to just define a field in the program to the size Ineed
initialized to semicolons and use it. Duh.all
</quote>
I want to take it a step further. Instead of doing this:
dcl-s DelimFill Char(37) Inz(*All';');
to initialize the variable with all semicolons, I want to initialize it
with a named constant I have already defined:semicolons
dcl-c efdFldDelim ';';
so I tried this:
dcl-s DelimFill Char(37) Inz(efdFldDelim);
But, as I expected, it only puts in a single semicolon. I tried this:
dcl-s DelimFill Char(37) Inz(*ALLefdFldDelim);
which throws a syntax error, as I expected. I'm guessing it's not
possible?
An alternative would be to initialize as blanks, then assign all
in one fell swoop, but this also throws a syntax error:have
DelimFill = *ALLefdFldDelim;
and I can't put quotes around efdFldDelim because then DelimFill would
"efdFldDelim" as it's contents.
Again, this not possible either?
Don't see examples in the manuals doing either of these. V7R1 up to
(RPG400-L)on PTFs.
Thanks.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com
The opinions expressed are my own and not necessarily the opinion of my
company. Unless I say so.
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
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: 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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com
The opinions expressed are my own and not necessarily the opinion of my
company. Unless I say so.
--
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: 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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.