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



Hi Peter,

Why VARYING(x) as opposed to VARYINGx? The former implies (to me anyway) that I can put whatever I want in there -- VARYING(1), VARYING(7), etc. Or maybe that's the intention; after all, why not?

I prefer VARYING4, VARYING8, etc, myself. However, Barbara said that they (the team at IBM) liked the parenthesis better. here's her message:
http://archive.midrange.com/rpg400-l/200705/msg00392.html


Let's be flexible. Aren't all these 2-byte, 4-byte integers simply those sizes because they're closer to what the hardware can handle?

Hardware typically is able to handle 1, 2, 4 and 8 bit integers natively. Note that when you define an integer in RPG (data types B, I and U) it must be one of those 4 sizes. Why would the prefix be different?

Bearing in mind that allowing other lengths (3,5,6,7 bytes) would make VARYING strings significantly slower, my question to you is this: What would be the advantage? Can you think of a situation where you'd want to use a 3-byte prefix, but a 4-byte wouldn't work just as well? Or a 5 byte where an 8 byte wouldn't work just as well? What would be the advantage of the other sizes?


Later responses mention a %indexsize BIF. Index? It's a current length subfield isn't it?. How about %sizelen, or %lensize or something? Unless it's considered an index to the end of the string...but I think most people think of it as the current length, hence the %len BIF.

I think something like %varysize() or %vsize() would be better than %sizelen() which seems ambiguous to me.

Or instead of giving us the size of the length prefix, maybe something like %addr(myVaryFld: *DATA) and %size(myVaryFld: *DATA) or %len(myVaryFld:*MAX)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.