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



The fact that these are dates is a good assumption - date's are maybe the best fit for a scenario of stripping leading digits, no matter what they are - because it's not REALLY a number - the context is different.

I've not tested John's %rem idea for negative numbers, either - due to context, I'd not thought of that.

So a more general solution isn't needed, because I assume our other code has generated a valid 8-digit date in YYYYMMDD.

Albeit an interesting conversation - thanks to all.

Vern

On 8/17/2013 6:22 PM, Joe Pluta wrote:
On 8/17/2013 4:59 PM, CRPence wrote:
Often there is great importance in taking care with replacing code in
a manner that ensures the new code works /the same/ as the original,
given the same inputs. Sometimes the complexity of prior or later
processing and the requirements is not conspicuous. Just like how
converting the input values to a date might be an assumption-too-far
[*ZERO and *HIVAL most conspicuously], so might be the assumption that
the EdtCde(X) is compatible. The 'unedited form' effected with the
Edit-Code-X will produce character string values that are incompatible
with conversion to decimal via %DEC when the input values are negative.
True dat, Chuck.

I did indeed assume positive numbers, and since the case seemed to be
dates I thought I was on pretty safe ground, but you're certainly
correct that negative numbers would fail spectacularly.

:)


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.