PDA

View Full Version : SAMPLE: Calendar Plugin


Desmond
09-26-2005, 03:30 PM
Hello,

This sample project demonstrates the Calendar Plugin.

Skills Used: Calendar Plugin Object, If Statements, Multi Line Input, Notes, Dates.

Update: Added actions to On Close event. Also added multi-line note support. Thanks to Worm for the technique!

rhosk
10-09-2005, 10:54 AM
Would someone take a look at this please. I have it writing & clearing entries in a text file (called: "businessCD.txt" in the windows folder - you need to put a blank txt file there). Adding and clearing is fine. But I would like the user to be able to edit an entry (without clearing it). When you edit an existing entry, I can't seem to figure out how to delete that existing entry before adding the update. You'll see what I mean when you look at the test, I hope :)

I guess a simple question would be: How can you search for the date in the text file and, not only delete that line, but the next line below it (without knowing what the string is). This would solve the problem, unless there's a much better way to do this entirely.

Intrigued
10-09-2005, 09:41 PM
I guess a simple question would be: How can you search for the date in the text file and, not only delete that line, but the next line below it (without knowing what the string is).

I have tried up to adding six (6) different blog notes-to-dates and then removing some in the middle and everytime it removes the date and the blog text immedately below that date. Thus, it seems your program is already doing what you intended it to do.

:yes

rhosk
10-10-2005, 06:14 AM
Hi Intrigued, thanks for looking. Here's the dilemma. Add a few dates and notes, works as expected. Now, if you "edit" a certain date - let's say you have a note for the 15'th of the month: "Pay the car payment"

-- Edit this note and add to it, "and walk the dog". The original "Pay the car payment" with the 15'th is still in the text file. Albeit, if you re-open the calendar, the only one you see is the latter one, so that part works great. Now, delete (or clear) the 15'th alltogether. Close the calendar, reopen, and the old 15'th note is there. It needs a way to not only ammend your note, but to delete the current note before updating.

Thinking off the top of my head (I hate doing that :D), may need an "Edit" button as well, disabling the add/update button at the moment. This way, you could grab the current text/date that's in the note box (when the user presses "Edit") and clear it that way. It would be better though if the user didn't have to retype everything using this method. I know it sounds confusing, and I know there's a way to do it, just can't grasp it right this second.....

Corey
10-10-2005, 06:24 AM
Edit this note and add to it, "and walk the dog". The original "Pay the car payment" with the 15'th is still in the text file.

Man that is some serious stuff, accidentally pay your dog one month and the next thing you know the repo man is at your door. And you know full well the dog's not going to return the money either. Man's best friend? Maybe so, but man's best treasurer? Forget it... Although I will concede that terriers do appear to exhibit slightly more fiscal sensibility than most. Or so they would have us believe anyhow... :o

rhosk
10-12-2005, 09:44 AM
Ah, finally figured it out. Used the OnFocus to grab the text string matched with the date.