Solved

adding "Tip for the day" or "Thought for the day" to your application

Posted on 2007-11-21
12
215 Views
Last Modified: 2010-04-04
I can't seem to come up with too much on google, and there's absolutely nothing on EE, so it's time to add this one to the index of knowledge...

I want to have a "tip for the day" every time the application loads.
Typically the form has a scroller so you can see "tomorrow's" tip or "yesterdays tip" too.
There's usually a checkbox that says "Always show tips when the application starts".

I suppose the hints themselves would be stored in a txt file.

Can any expert mash together some kind of randomise function to fetch a random tip and place it in a memo, or even better, point me to an existing example or component for this.

Thanks!
0
Comment
Question by:rfwoolf
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 19

Assisted Solution

by:MerijnB
MerijnB earned 100 total points
ID: 20328995
check here, lots of them: http://www.torry.net/pages.php?id=495
0
 
LVL 18

Assisted Solution

by:Johnjces
Johnjces earned 75 total points
ID: 20329326
0
 
LVL 4

Assisted Solution

by:BedouinDN
BedouinDN earned 75 total points
ID: 20331918
The Jedi VCL also has a Tip of the Day component.
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 20332698
Hmm... thanks...
but it seems they all like to use dialogs! I want the tip of the day to appear in my login form.
I've opened up JvTipOfDay.pas but it doesn't seem to have an associated dfm - i.e. its form may be created at runtime.
I might have to create this myself :(
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 20333131
ok, what part are you looking for then? You say that you want to make it in your login form yourself.
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 20333148
Hmmm... it should be quite easy to do. I would have a text file with all the tips.
Then I would have an INI file which lists the last line number (tip number) that was loaded.
The application would check the line number, incremement it by 1, then load the number into the editbox.

I suppose it would be nice if it **looked** like the Jedi VCL component does, you know, that "typical" tip for the day look.

Should be easy enough :)
If I have any trouble I will post a new question asking help for that so we don't contaminate the points for this question
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:MerijnB
ID: 20333184
so... what is it you need for this question then?
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 20333189
MerjinB I am keeping this question open a bit longer to see if there are any other answers.
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 20333194
ok, got it
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 20335778
I ended up using a stringlist's LoadFromFile, and then saying MyStringList.string[4] if I want the 4th tip, etc.
To record the number of the latest tip, i store in an INI file (although technically it can be stored in the txt file)

I will close this question soon.
Thanks for all the answers
0
 
LVL 2

Accepted Solution

by:
bogdan_iuly earned 150 total points
ID: 20337508
Hello,

I see you have found a method to do it, but I thought this ideea might help you more.

You can use the following method to display the tip of the day:

The StringList is a little buggy, because if you have a tip on two lines, it will separate it and it will show it as two different tips.
Store the tips in Tips.ini, for example, in a structure like the one below:

[General]
LastID=1
NrTips=3

[Tips]
Tip1=tip1
Tip2=tip2
Tip3=tip3

1. Check if ini exists and if so, execute steps 2-5, otherwise show a message, hide the panel that displays the tip, etc ... This depends on your implementation.
2. Read from the ini the ID of the last shown tip (=LastID) and the number of tips (=NrTips); both with a default value of 0
3. Increment LastID
4. If LastID is bigger than NrTips, then make the LastID equal to the ID of the first tip.
5. Save LastID to the ini file.

If you need code, just let me know and I'll create the program and post the code here.
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 20501470
Did any of this help you?

John
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now