article

Text that types itself!

Email
Submitted on: 1/2/2015 7:32:00 AM
By: Anonymous (from psc cd)  
Level: Advanced
User Rating: By 4 Users
Compatibility: Borland C++
Views: 1191
 
     The following code, when running, looks like the text is actually typing itself. This technique uses two main things, char arrays and the Sleep(); function. This technique would be great to use for slash screens, presentations or just impressing your friends! Also, please take the time to vote for my code. Thanks!!

This article has accompanying files
 
				Create a form with a Label component and a Timer component.
Create an event handler for the timer(double click the timer) and place the following code in the event handler. When the program is run, the text will appear to be typing...a little trick using char arrays and the Sleep(); function.
The code looks VERY cluttered and so I have included a downloadable version of the following code that is a .txt file that is easier to read.
************************************************************************************************
Sleep(300);
char fifth[30][11] = {"T", "y", "p", "i", "n", "g", " ", "T", "e", "x", "t"};
if (Label1->Caption != "Typing Text")
{
	Label1->Caption = Label1->Caption + fifth[i];
i = i + 1;
}
else
{
	Label1->Caption = "Typing Text";
Timer1->Enabled = false;
}
************************************************************************************************

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 21 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.