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



Hello!

Please, can somebody explain me what are exactly *MONTH, *DAY, *SYS, 
*YEAR, *OMIT, *NOPASS etc. values?? Where are they stored when program 
runs??

I have subprocedure that does some time calculations. I would like to pass 
optional parametar to it (*MONTH,*DAY,*YEAR) but if I pass it as in PI 
(10A) builtin function wont accept it because it has no same parametar 
type. I wonder is there any way to make call to getInnerPeriodLength on 
this way getInnerPeriodLength(d1,d2,d3,d4,*MONTH).

Here is te code (for now I just *DAYS):


     P getInnerPeriodLength...
     P                 B                   EXPORT
     D getInnerPeriodLength...
     D                 PI             5P 0
     D  dateZStart                     D
     D  dateZEnd                       D
     D  dateKStart                     D
     D  dateKEnd                       D
     D  resultUnit                   10A   OPTIONS(*NOPASS) VALUE
     D  checkWildCard  S               N   inz(*off)

      /free
        
        If dateZEnd<dateZStart;
           return 0;
        EndIf;
        
        If dateKEnd<dateKStart;
           return 0;
        EndIf;
        
        If %Parms()>4;
           checkWildCard=*ON;
        EndIf;


        Select;

        
          WHen dateZStart>dateKStart AND dateKEnd>dateZStart
               AND dateKEnd<dateZEnd;
               return %Diff(dateKEnd:dateZStart:*DAYS)+1;

        
          WHen dateZStart<dateKStart AND dateKEnd<dateZEnd;
               return %Diff(dateKEnd:dateKStart:*DAYS)+1;

        
          WHen dateZStart<dateKStart AND dateKEnd>dateZEnd;
               return %Diff(dateZEnd:dateKStart:*DAYS)+1;

        
          WHen dateZStart>dateKStart AND dateKEnd>dateZEnd;
               return %Diff(dateZEnd:dateZStart:*DAYS)+1;

          Other;
               return 0;
        EndSl;

      /end-free
     P                 E 

Thank you!

Igor Bešlić, dipl. ing. rač. 
Zelinska 2, 10000 Zagreb
tel: +385 1 6326422

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.