|
a file named BLANK (because the first 10 posiitons of MsgFile are blank)This is why the API is sending an error to begin with, it's looking for
in a library named GENERICMSG.
the file is not available at runtime, I get the error predicted by BruceThat does not explain why the first call hasn't crashed the program. If
Vining.
you're referring to. Pointers to documentation and accompanying keywords >>May I kindly ask you to elaborate? I don't understand what exactly
Hello Scott,
I'm flattered! An answer from the master himself! :-)
Am 29.01.2020 um 21:38 schrieb Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>:
1) You have a variable named ErrCode that is 16A and has been left atthe default value of blanks.
Yes, I gleaned that from examples.
However, APIs use a data structure for the error code, not a characterfield. The first 4 bytes of the data structure are the length, in bytes,
of the structure. Since yours are blanks, the API thinks you've provided
more than 1 gb (more than one billion bytes) in which it can return error
information.
Oh. Thanks for pointing out!
2) Your 'MsgFile' variable will have GENERICMSG at the *end* of thestring rather than the start because you're doing a MOVE rather than a
MOVEL.
Okay. I'm still struggling with the concept of fixed-length, blank-padded
strings and their peculiarities together with MOVE vs. MOVEL. I know the
technical difference but sometimes I just can't predict the outcome. :-)
This is why the API is sending an error to begin with, it's looking fora file named BLANK (because the first 10 posiitons of MsgFile are blank) in
a library named GENERICMSG.
That does not explain why the first call hasn't crashed the program. If
the file is not available at runtime, I get the error predicted by Bruce
Vining.
That's as much as I had time to look into.
Thank you for taking time for the Noob with the Dinosaur-Aged machine. ;-)
Also, you say you have to code this for V4R5, but... you are actuallycoding it for RPG/400 (RPG III) -- just using the RPG IV line spacing.
Maybe? I'm following the docs (ILE RPG Reference v5.pdf)
Even at V3R1 (which is several releases earlier than V4R5) you could'vecoded this in a nicer way by using RPG IV features such as EVAL and
IF/ELSE/WHEN with expressions that would've made it much easier to see the
mistakes you're making and much easier to fix. Your coding style is over
26 years out of date, and is making it harder to write and maintain your
programs.
Thanks (again) for pointing out. I'd consider myself still a rookie in
terms of coding in RPG. I have some experience with C on Linux but that
doesn't help much. :-)
:wq! PoC
PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com
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.