Monday, July 28, 2025

Adding comments to the blog manager program

Following on from yesterday's blog1 about comments: after I authorised the 82 comments that had been left, I received each comment in a separate email. The question that I then asked myself was 'How can I add these comments to the blog manager program?'. 

In a similar manner to storing posts, the first action is to save the email in HTML format which my oldish version of Outlook does perfectly. This results in files with names such as "Perceptions New comment on the 8-puzzle..htm". The major problem with reading the file is the file name - there are two full stops next to each other. That was easily dealt with, but the problem of commas and similar punctuation is more problematic. In the end, I solved this by both editing the blog's title and the file name in order to ensure its being read. I can't use the same idea of finding blogs that don't have comments, as there are far more blogs than don't have comments than those that do, and a blog can have more than one comment.

Once the comment text had been saved, I had to program how to retrieve it. An option of the 'show entries' dialog brings up a list of comments for a given blog, and from this list, a comment can be chosen. At the moment I don't have more than one comment per blog, but the capability exists for more than one comment per blog.

In short, there weren't any major problems in adding the comments. I have already thought of improvements although I don't know whether I'll bother - for example, first of all saving the name of the person who added the comment, then accessing comments per person.

Internal links
[1] 1972



This day in blog history:

Blog #Date TitleTags
18628/07/2009Speed, speed, speedProgramming, Office automation
27028/07/2010The in-basket 5In-basket
61328/07/2013A neat hack: right clicking a grid's title barProgramming, Delphi, ClientDataSet
115828/07/2018100 yearsPersonal

No comments: