Value of Null?

BlitzMax Forums/BlitzMax Beginners Area/Value of Null?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Dude, please chill out... :) I know how frustrating it is to bang your head against a problem like this, and I sympathize, but if it were easy, anyone could do it - the difficulty is what makes it worthwhile.

First off, it's never occured to me to wonder how many weeks were in a specific year (the thumbnail of 52 works well enough for my purposes). Secondly, I'd never heard the "ISO 8601 week" until you mentioned it. So, I don't think that you'd need to scrap the rest of your project just because the week counting business doesn't work out: the other functions sound useful even without it.

However, since the first week of the year is defined as the week with the year's first Thursday in it, wouldn't counting the number of Thursdays in a given year thus give you the number of ISO weeks in that year? (Forgive me if you've already gone over this approach.) If nothing else, a brute-force iteration of all days in the year (1-365/6) run through your day-of-the-week function while incrementing a counter for each "Thursday" returned should do the trick (unless I'm overlooking something). By assigning the week number based on how its Thursday falls, then all the other days of that week share that week number, no?

I can't see your code, so I don't know if looking at it this way helps. But as a last resort, just set the week numbering business aside - it doesn't strike me as that big a deal to tear your hair out over.