|
Excellent explanation, Hans! And right along the lines that I was thinking of. Still, I wonder (but don't doubt your word) why the compiler can't "see" that the field-length prefix isn't being set. Maybe easier, if it isn't even being referenced? I told my colleagues not to lose too many brain cells on this; just use the EVAL and life will be good. Thanks again! GA --- Hans Boldt <boldt@xxxxxxxxxx> wrote: <snip> > I think this is largely a case of "working as designed". > > To summarise the rules: When using varying length variables within > the traditional fixed-form calcs (not the expression calcs), a > varying length variable works the same as a fixed length field > defined with the current length. That is, if the current length of a > char varying field is 10 (regardless of the declared maximum > length), then the operation works the same as is the field were > fixed length 10 chars. > > Of course, if the current length is 0, then there's not really an > analogue in the fixed length case. But we're not going to make any > change to the compiler that might possibly regress users, and so > that behavior ain't gonna change. > > Why this way? The rules for char result on the old fixed-form calcs > get in the way of meaningful rules for varying length variables. For > example, for many fixed-form opcodes, char results are generally > unpadded and right adjusted. Just how exactly do you right-adjust a > value in a varying length result? We settled on the current rules > for fixed-form calcs since you get the results you generally expect > in the expression calcs anyways, and we wanted to keep the rules > consistent for all fixed-form calcs. > > Regarding a warning (sev 10) message, I can't think of any warning > that would specifically warn about this situation. The compiler > generally can't know that a varying length variable never gets its > length set. > > Cheers! Hans __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
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.