× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Emmanuel, Scott,

I have reviewed the thread in order to pick up a few points myself and I thought I'd share what I found:


Emmanuel,

Regarding the first parameter of the open API, Scott in indeed correct. You can (and should) simply place the name of the varying field containing the file name here. The extra "pointer" work is unnecessary and incorrect. So, for the open in program readFile you simply need:

// Open file for reading text data...
fileDesc = open(fileName :O_TEXTDATA + O_RDWR);

I believe the other parameters on the API call, and the other lines in the examples I provided are OK, and all works well for me. It was just this one parameter which is incorrect.


Scott,

Regarding your notes in the last mail to me:

<snip>
Notes:
-- You do not need to use %addr() or pass a pointer.  In fact, if you
  _do_, you'll create problems, because the automatic x'00' will no
  longer be added.
</snip>

Point taken, and a lesson learned. Thank you.

<snip>
-- You do not need to add x'00' manually, options(*string) adds it for
  you as long as you're bright enough not to pass a pointer.
</snip>

It's interesting that you equate knowledge of RPG with intellectual prowess. It would appear that I am not "bright enough" because I chose to pass a pointer in this case. I would sincerely question the logic that leads you to this conclusion. But again, point taken about the pointer - again.

<snip>
-- You do not need to add 2 to the address. Since you're not passing
  a pointer, but are using the functionality of the RPG language, it
  KNOWS that your field is VARYING.  It KNOWS that the intended result
  is a null-terminated string.  It'll convert it for you.
</snip>

Again, point taken about the pointer - again.

<snip>
The really frustrating part is that I've already explained this to Emmanuel, and a day later you come and do it wrong, and convince him to do it wrong. It's enough to make you want to chew your own foot off!
</snip>

It's also interesting that given the option of chewing your own foot off or taking a swipe at me - you chose the latter. Granted, a small part of my two code samples was incorrect, and granted you have the right to point this out. I'll even concede that you was frustrated because my "incorrect" solution was taken up and your "correct" advice was not heeded. However, I would appreciate it if you tried not to vent this frustration on me.

You are an extremely talented programmer, there's no denying that. But have you ever wondered why so few programmers post "solutions" to this forum? I would suggest it is because they want to avoid exactly this kind of response if they get a little part of their code wrong. Many of us are all still learning, and we are trying to pay back a little for the good advice we've been given by other members of this list. Of course we'll get some things wrong, and it is right that we're corrected when we give incorrect advice. But I'm not here for you to vent your frustration on.

So, next time you feel the urge to chew your own foot off - please take your boots off first. :-)

Cheers, and thanks for your time.

Larry Ducie



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.