Bruce
01-23-2008, 03:21 PM
If I try clearing a day of its info it comes back when I click on it again. DB is not deleting the info.
My code:
In the plugin:
--On Select
--This is single selection so don't worry about e_EndDate
--First Disply the Date
Label.SetText("txtDate", e_StartDate);
--Does this blog entry exist?
if (not (tbBlog[e_StartDate])) then
--Set the Text
Input.SetText("inpBlog","");
else
--Set the Text
Input.SetText("inpBlog",tbBlog[e_StartDate]);
end
In the clear button:
--Set the Text
Input.SetText("Event", "");
--Get the selection
tbSel = Calendar.GetSelection("Calendar");
if (tbSel) then
SQLite.Query(db, "DELETE FROM Cal WHERE Date = '"..tbSel.Begin.."'");
tbBlog[tbSel.Begin] = "";
--Remove the Selections special date (if it exists) becuase
--the text is blank
tbSpecial = Calendar.GetSpecialDates("Calendar");
if (tbSpecial) then
Calendar.ClearSpecialDates("Calendar");
--Now re-Add all special dates
for strCount, strDate in tbSpecial do
if (strDate ~= tbSel.Begin) then
Calendar.AddSpecialDate("Calendar", strDate);
end
end
end
result = Dialog.Message("Delete Error", "No Date with an Event selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
Any ideas?
My code:
In the plugin:
--On Select
--This is single selection so don't worry about e_EndDate
--First Disply the Date
Label.SetText("txtDate", e_StartDate);
--Does this blog entry exist?
if (not (tbBlog[e_StartDate])) then
--Set the Text
Input.SetText("inpBlog","");
else
--Set the Text
Input.SetText("inpBlog",tbBlog[e_StartDate]);
end
In the clear button:
--Set the Text
Input.SetText("Event", "");
--Get the selection
tbSel = Calendar.GetSelection("Calendar");
if (tbSel) then
SQLite.Query(db, "DELETE FROM Cal WHERE Date = '"..tbSel.Begin.."'");
tbBlog[tbSel.Begin] = "";
--Remove the Selections special date (if it exists) becuase
--the text is blank
tbSpecial = Calendar.GetSpecialDates("Calendar");
if (tbSpecial) then
Calendar.ClearSpecialDates("Calendar");
--Now re-Add all special dates
for strCount, strDate in tbSpecial do
if (strDate ~= tbSel.Begin) then
Calendar.AddSpecialDate("Calendar", strDate);
end
end
end
result = Dialog.Message("Delete Error", "No Date with an Event selected.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
Any ideas?