CompuServe Messages

Date searching

    05-Jul-94 16:36:53
Sb: Date searching
Fm: Henry Williams 73527,1446
To: ALL
Hello gang, Could someone please have a look at my 'if' setup. I wrote a function to find all dates in a file between the from and to structs. As you see I have set the initial variables to near infinity. If I don't change the dates all the records in my file are called. However, if I put in a range I often get nothing even though I have checked and confirm dates in the range. Although this algorythm looks good to me, can anyone tell me whats going wrong? Or, if you have some school taught method for this I would appreciate your help as all I know from programming is what I learn from a book at home. I'm using an old Manx 3.6 compiler. date_search() { struct date actual, from, to; from.day = 01, from.month = 01, from.year = 0000; to.day = 31, to.month = 12, to.year = 9999; if (actual.year >= from.year && actual.year <= to.year && actual.month >= from.month && actual.month <= to.month) if (actual.day >= from.day && actual.day <= to.day || actual.day < from.day && actual.month > from.month || actual.day > to.day && actual.month < to.month) } THANKS FOR THE HELP! Henry