Solved

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

Posted on 2007-11-21
12
211 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

11 Experts available now in Live!

Get 1:1 Help Now