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



Scott,

That's great. I'm  100% with you on this.
I just wanted to clarify that there wasn't a problem with 4-byte binary
fields (9B0 values).
I hate them too, and I also am very disappointed in the fact that we
have to declare a 4-byte binary field (i.e., an Int4 value) as 10i0. I
really wish it would have be 1i, 2i, 4i, 8, etc.
It is so diffucult to teach someone about Ints and talk about 2, 4 and
8-byte ints, and then have them declare a 4-byte in as 4i0 and get a
compiler error. :(

Bob Cozzi

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On Behalf Of Scott Klement
Sent: Friday, December 13, 2002 12:03 PM
To: rpg400-l@midrange.com
Subject: RE: API QIMGCVTI



The 'specific issue' with '4B 0' is that when the API manual says
'Binary(4)' it wants a 4-byte variable.   4B 0 is a 4-digit, 2-byte
variable.   That causes big problems.

Since this is a common 'gotcha', I always tell people to make sure
they're
using '10I 0' not '4B 0'.   The really important factor there is the
increase from 2 bytes to 4 bytes.

I could tell him to make sure he's using '9B 0' instead of '4B 0'.
You're right, that 9B 0 would work, so long as we didn't exceed 9
decimal digits.

But why?   Why would I tell him to use '9B 0'?  Yes, it works 99.9% of
the
time, but '10I 0' works ALL of the time.   '10I 0' also performs better.
It's not significantly harder to type '10I 0' than '9B 0'.  Once
defined, you use it in EXACTLY the same way.  There's no downside to
using '10I 0'
that I can see.   So, if I have to recommend one or the other, I'm going
to recommend using '10I 0'.


On Fri, 13 Dec 2002, Bob Cozzi wrote:
>
> Have you found a specific issue with 4B values? I never use them and
> haven't for years, but I've been under the impression that they can be

> used interchangably with 10i0 values provided the numeric range isn't
> outside the scope of the variable.
>

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@midrange.com To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.