|
Hello group,
I have a field named XCVAR1 in a database file with a size of 150 bytes
defined with the DDS keyword VARLEN (no size specified).
I understand that this field initially has a length of zero.
Just setting the field XCVAR1 works;
XCVAR1 = 'false' ;
but there might be other values in this VARLEN defined field that I should
leave intact (and at the same offset) when they were set by other programs.
When trying to set the field to a value like:
%subst(XCVAR1:1:5) = 'false';
the programs throws an error complaining about invalid field size.
If I first set the XCVAR1 field size like;
if %len(XCVAR1) < 5;
%len(XCVAR1) = 5;
endif;
all is well.
Should the compiler not just set the length of XCVAR1 to 5 when I assign
the
value 'false' if the XCVAR1 length is less then the value I want to set
using the %subst function or can someone explain why not?
Kind regards,
Loek Maartens.
--
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 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.