× 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.


  • Subject: RE: RPG400-L Digest V3 #74
  • From: "Cindy Hudson" <cindy_hudson@xxxxxxxxxxx>
  • Date: Tue, 6 Feb 2001 16:32:52 -0800
  • Importance: Normal

So is there any book out there to help us poor souls?

-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On
Behalf Of Scott Klement
Sent: Tuesday, February 06, 2001 3:03 PM
To: RPG400-L@midrange.com
Subject: Re: RPG400-L Digest V3 #74


Jim Langston wrote:

> Hmm... So you're saying, Scott, that it's not their job to show us how
> to use these APIs in RPG.  1 page in the beginning of the manual showing
> how to declare each variable in each language would be sufficient.  But
> we don't even have that.
>

I agree with a simple chart to show the data types in common languages
as a convienience feature, but I don't think its really NECESSARY.

> So, if it's not the job of the API manual to show us how to use them, what
> is the job of the API manual?  And, yes, I realize I am splitting hairs,
but
> how many RPG programers haven't used the APIs just because the
documentation
> didn't explain how to use them in *their* language, RPG?

What I'm saying, Jim, and what I've SAID several times now is that
a "APIs in RPG" book should be a seperate document.  I'm not saying
that it shouldn't exist.

The API manuals that we currently have are NOT RPG specific.  So
explaining how to do them in RPG would be beyond the scope of the book.

>
> I know C, I know binary, I know pointers, but no way could I have told you
> to code their 4B as 10i 0!!!
>

I'm a bit confused as to what "4b" and "10i 0" have to do with pointers
or coding in C.

The API manual does specifically state that "Binary(4)" is a 4-byte binary
variable.  The RPG manual specifically states that "4B 0" is a 4-digit
binary variable.

The problem, IMHO, is that a RPG programmer will skip right to the part
of the manual where the parms to an API are defined.  He will then proceed
to code it as "4B 0" because it says "Binary(4)" without ever looking to
see what Binary(4) means!

If that's the case -- then why do you think he'd stop and look at the
proposed chart at the start of the manual to see how to code it in a
given language?!

The only way to solve that problem is to define it as "Binary(9)" next
to each parameter in the manual -- which is JUST PLAIN WRONG, because the
manual is not RPG IV specific.


Here's a Binary(4) defined in RPG III:
     I            DS
     I                                    B   1   4 BIN4


Here it is in CL:
             DCL        VAR(&BIN4) TYPE(*CHAR) LEN(4)
             CHGVAR     VAR(%BIN(&BIN4)) VALUE(0)

Here's a binary(4), defined four different ways in RPG IV:
D                 DS
D bin4a                   1      4B 0

D                 DS
D bin4b                   1      4I 0

D bin4c           S              9B 0

D bin4d           S             10I 0


Here it is in C, two different ways:

     int bin4 = 0;
     long bin4 = 0;


Notice that in MOST CASES, "Binary(4)" would make more sense than
"Binary(9)" would.   In the case of C, and RPG IV you'd have to actually
know the language to know what a 4-byte integer would be.

Again, the differences in how all of this is defined in all of these
different languages is EXACTLY WHY there should be seperate books showing
how to use the APIs for each language.

Thanks for your input...

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.