|
Andrew, A couple of questions: What release are you at? Are you willing to do this in RPGIV? For starters you need to determine which day of the week the 1st day of the month is. A search of the archives at midrange.com will provide you with a variety of answers. Then when you create your calendar, you can decide if the first day of the week is Sunday or Monday. To determine if the year is a leap year, you can either test for the validity of 29.2.xx or use the old fashioned way, test the full 4 digits i.e.: 2000 if it divides evenly by 4, test if divides by 100, test if it divides by 400. Use the MVR opcode immediately after the DIV to determine if there is a remainder. If divides by 4, but not 100, it is a leap year. If divides by 4, and also 100, it is -not- a leap year unless it also divides by 400. HTH areavill wrote: > Dear Sir, I am trying to write what to you is probably a simple > program in rpg400 and I wonder if you could give me any pointers. The > program accepts ayear from the user between 1900 and year 2000, for > example 1959 and it must decide whether or not it is a leap year and > then produce a calendar with the correct number of days in each month > with the correct corresponding day example 21.1.01 would be next to > Sunday etc. I would be grateful for any pointers. ThanksAndrew +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.