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



>> if    date = %range( 20030101 20030201 )
>
>YES!  I would go for this.

If you would go for this, then write it!

I have preached on this topic in the past and it seems an appropriate time to 
do so again:  one of the beautiful things about ILE is the ability to write 
one's own BIFs.  In essence, RPG has become xRPG - extensible RPG!

A function like this would be simple to write and could be easily incorporated 
into your code:

Write a sub-routine called inDateRange.
Send it 3 parameters, testDate, BegDate and EndDate.
Return an indicator based on whether or not the testDate falls within the 
confines of the beginning and ending dates.

In your code it would look something like this:

if inDateRange( myDate : begDate : endDate );
...
endif ;

Define the module for export, create a service program, and put the service 
program into a global binding directory.  *(the service program part is an 
optional step since you can put the module itself in the binding directory, but 
I would recommend taking the service program approach.  There are numerous 
benefits but it is too much for this message).

Now the BIF "inDateRange" is available to all of your programs provided that 
they reference the binding directory.  That's why we have one global binding 
directory.  These are all of our tools and BIFs that would be useful regardless 
of the application.  Date routines, string manipulators, math functions, etc. 
all go in this global directory, and in essence we have a custom extended 
version of RPG.

It sounds like more work than it really is but I think you will find such an 
approach well worth your while.


Cheers,

Joel

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.