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





On 16-Jul-09, at 4:26 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

Yes, when you use %len() to increase the size of the field, the newly
available characters are set to blank.

That bit I knew - what I wasn't certain of was what value was assumed if the length portion was invalid as it would be if it was not initialized and was in a DS. Turns out it assumes zero - not a bad default I guess.

I used this to test it - which certainly proves that only the extra characters are blanked!

D testDS DS
D testvar 10a varying
D varData 10a Overlay(testVar: 3)

/free
varData = 'ABCDEFGHIJ';
%len(testvar) = 5;
dsply ('[' + testVar + ']');
dsply ('[' + varData + ']');
*inlr = *on;


What did surprise me - although it makes sense too - is that if the length of the field is reduced, that the now unused positions are not blanked. I was sure that Barbara had told me a long time back that the back end was blanked when the length was reduced - but this code makes it look like that is not the case - at least currently.

D testDS DS
D testvar 10a varying inz('ABCDEFGHIJ')
D varData 10a Overlay(testVar: 3)

/free
%len(testvar) = 5;
dsply ('[' + testVar + ']');
dsply ('[' + varData + ']');
*inlr = *on;



Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.