I think I've figured out how to set up a flexible between-date-entry search: Two boxes, one for start date and one for end date.
If a box has an entry number in it, good, keep going; otherwise, convert (what's assumed to be a date in there) into a month, day, and year. Do binary search starting from the closest journal entry with a number divisible by 1000 until an entry is reached that is the first one on that date OR the closest one to that date, then return that entry number. Move to the next box, same deal. After those two vars hold entry numbers, return an array that contains all the entries between. Convert those to titles and create a hash to convert title to entry (since the entrytitled() function's been flaking out on me for reasons I don't comprehend yet) and retrieves that entry, dumping it in the primary display text object.
(I still have to see if this causes stress to use.perl;, but I can't see how it would. I can't imagine how it could be made more efficient. If you can, please, let me know.)
I was explaining this all to Laura, my SOTF, in order to help me decide if I wanted to create an iterative function to determine the dates or a recursive one.
"...the GUI-"
"Graphical User Interface?"
*pause* "Yeah. What am I building it with?"
"Perl/Tk."
Maybe she really is listening when I'm talking.
Not sure if you already have in mind what module you'd like to use for dates, but I highly recommend Time::Piece.
Re:Date code
chaoticset on 2002-05-15T03:15:52
The words "time piece" were going through my mind when I was scribbling these ideas down, but I figured it was an old bad memory of an Inform library called timepiece.h, something that never quite included properly.Suggestion notedm research follows...thank you.
:)