Mail Archives: djgpp/1998/03/13/09:31:09
From: | PeeTee <peter95 AT hem DOT passagen DOT se>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | HELP ME...
|
Date: | Fri, 13 Mar 1998 06:52:23 +0100
|
Organization: | Telia Internet Services
|
Lines: | 68
|
Message-ID: | <3508C997.83D06415@hem.passagen.se>
|
NNTP-Posting-Host: | d2o44.telia.com
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi out there!
I have a problem and i think somebody can solve it easy...
In a program i want the user to enter a search sting...
But the problem is that while he do this, the program must do other
things at the same time (almost...)
The code looks like this:
char search_for[256];
int ok;
enter_string()
{
if(key[KEY_ENTER])
ok = TRUE;
// Code that adds the pressed key to search_for
// if enter isn't pressed...
}//end of enter_String()
main()
{
//lots of code...
ok = FALSE;
do
{
redraw_graphics();
enter_string();
}until(ok);
// more code...
}//end of main()
The point is that enter_string don't wait for a ENTER... The program
loops and add entered keys to search_for.
The loop ends when the user press ENTER.
I tried to use
if(keypressed())
search_for = search_for + readkey();
but search_for looks funny when i use textout...
I hope you understand my little problem and help me asap.
Sorry for any misspelling or use of bad gramatics... (Hey, i'm from
sweden... ;)
/Pete
QQQQQQQQQQQQQQQQU%\..)%GQQQQQQQQQQQQQQQQQQQQ
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQDGy%%KU8QQQQQQQQQQQQQQQQQQQQ
QQQQQQQ8DGGKKGGU88QQQQQQQ8DUUD888DGGGDD8DUGGGD8QQQQQQQ8DGKyyyKU8QQQQ
QQQQ8UK%ZZZZZ\\"JKU8QQQQDGy%%KKGK%"Z%KUUK%ZZ%KUQQQQDUKy%\~??~~\%KUQQ
QQQUKZ~;;)Z""))~)ZJU8QQQKyZ\\%""Z\)\%KDyJ~??"JDQQDUy%Z~???~?; `.~JGQ
QQUJ). ?\JKUGK%")\ZyGQQ8yJ\\ZZZ%JyyKUD8y%~?~JyQ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