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



>This is part and parcel of the 'expression' rules for EVAL.
Basically, 'fiscalYr - 1' is an expression.  In order to hold all the
possible digits of the resulting value, the compiler applies some rules to
create an 'intermediate' or 'work' variable.  The %editc() is working
against the work variable.

I wondered about that.  I should have tested that.  Changing my program
from:
       headdesc = 'Fixed Model FY ' + %editc(fiscalYr - 1:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year1 - 1:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year2 - 1:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year3 - 1:'X');
       dsply headdesc;
to:
       headdesc = 'Fixed Model FY ' + %editc(fiscalYr:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year1:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year2:'X');
       dsply headdesc;
       headdesc = 'Fixed Model FY ' + %editc(year3:'X');
       dsply headdesc;
changed the results from:
DSPLY  Fixed Model FY 02001
DSPLY  Fixed Model FY 02002
DSPLY  Fixed Model FY 02003
DSPLY  Fixed Model FY 002004
to:
DSPLY  Fixed Model FY 2002
DSPLY  Fixed Model FY 2003
DSPLY  Fixed Model FY 2004
DSPLY  Fixed Model FY 02005


It just baffles me as to why the compiler thought to add an extra digit on
a subtraction.  Granted if it was a variable, and there was a possibility
that the variable was negative, then it would make sense.  (Negative minus
a negative is an addition.  And if year was 9999 -(-1) would be 10000 or
0000 in 4 digits.)  But that isn't the case here.

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.