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



I encountered a similar situation once. That is why I sometime clear
variables before using them.

Albert

On Tue, May 22, 2012 at 1:29 PM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:
On 2012/5/21 5:22 PM, Jon Paris wrote:

... I seem to recall a
conversation with Barbara where she told me that they had decided
that setting the back end of a varying to blanks was probably a waste
of time but by then couldn't change the behaviour because undoubtedly
someone had decided it was a "feature" by then.


Jon, I sort of recall a conversation about that, but not the details.
Maybe I was explaining that we _couldn't_ set the unused chars to blank
because of compatibility (assuming we'd even want to).

Even initialization doesn't set unused chars to blank, although with
data structure subfields it might appear as though it does.

D ds              ds
D   fld1                  1      6a   inz(*all'a')
D   varOver               1      6a   varying inz('12')
D   varAlone                     5a   varying inz('xyz')
D varfld          s              5a   varying inz('abc')

===> EVAL DS:x
  0002F1F2 81810003 A7A8A940 40......   - ..12aa..xyz  ...

Only the "good part" of varOver is set, so the last part of fld1's
initial value of all a's gets through. For varAlone, it looks like the
end of the data is set to blanks, but that's really just the default
initial value of the DS.

===> EVAL varfld:x
  00038182 830000.. ........ ........   - ..abc.

The unused part of varfld is explicitly set to hex zeros. That might
also might be what you were recalling?

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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.