Board index » delphi » Question: Doing two things at once?

Question: Doing two things at once?

I was wondering how I could display a ticker-tape message on the
screen, while I do other tasks like enter in information on the
screen.  All of this going on at the same time.
Wi...@Nando.net
 

Re:Question: Doing two things at once?


Quote
BaliztiC (wi...@nando.net) wrote:

: I was wondering how I could display a ticker-tape message on the
: screen, while I do other tasks like enter in information on the
: screen.  All of this going on at the same time.
: Wi...@Nando.net

well, from my experience, you wouldn't be able to have any functions
where the computer waits for the user to do anything, or delay(x)'s, etc,
unless you had some sort of tsr to make the ticker tape scroll by. for
the equivalent of ReadLn, what i do, is just go

Repeat
  Repeat
    graphics stuff here, update tickertape
    blah
  Until KeyPressed;
  c := ReadKey;
  if c = (chr(27)) then halt(0);
Until c = (chr(27));

or something like this... the thing repeats until a key is pressed, then
it reads the key to C, and you can do whatever with c... you could have
"normal" input by printing each occurrance of C out, and adding each
occurrance to a string, and doing whatever with the string, but it can
get annoying sometimes...
victor dods

Re:Question: Doing two things at once?


 BaliztiC  (wi...@nando.net) wrote:

Quote
> I was wondering how I could display a ticker-tape message on the
> screen, while I do other tasks like enter in information on the
> screen.  All of this going on at the same time.
> Wi...@Nando.net

        Why don't you try capturing the clock interrupt which is activated
18,2 times per second? You can change it for a procedure of you.
Hope this helps,
        Sergio

Re:Question: Doing two things at once?


In article <4lndrg$...@pinon.ccu.uniovi.es> i3978...@petra.euitio.uniovi.es (Sergio Martinez Herrera) writes:

Quote
> BaliztiC  (wi...@nando.net) wrote:
>> I was wondering how I could display a ticker-tape message on the
>> screen, while I do other tasks like enter in information on the
>> screen.  All of this going on at the same time.
>> Wi...@Nando.net
>        Why don't you try capturing the clock interrupt which is activated
>18,2 times per second? You can change it for a procedure of you.
>Hope this helps,
>        Sergio

Depending on what environment you're in, a Windows timer (or Delphi TTimer
object) could provide the functionality most easily.  

Otherwise you probably need to check the ticker-tape message in a loop that is
waiting for a keystroke.  Unless you want mongo-fancy timer-interrupt stuff.  
:-)

Re:Question: Doing two things at once?


Quote
mang...@netcom.com (Victor Dods) wrote:
>or something like this... the thing repeats until a key is pressed, then
>it reads the key to C, and you can do whatever with c... you could have
>"normal" input by printing each occurrance of C out, and adding each

Create an interrupt routine, hook it into the timer interrupt, and
every so many ticks, increment your pointer to your string.  I've
heard that dos calls are not reentrant, so in your tsr you should
detect the monitor type and mode, and onlydisplay in text modes.

http://www.webworldinc.com/joejared/index.htm
ftp://webworldinc.com/joejared/
--- Fidoknot v1.0
* Origin: Yorba Linda, CA (joeja...@webworldinc.com) BP8.0 please... Not everyone uses Windoze.

Re:Question: Doing two things at once?


In article <317d996b.216...@news.nando.net>, From wi...@nando.net
( BaliztiC ), the following was written:

Quote
> I was wondering how I could display a ticker-tape message on the
> screen, while I do other tasks like enter in information on the
> screen.  All of this going on at the same time.
> Wi...@Nando.net

Do the displaying from an ISR procedure that serves the timer tick:

PROGRAM xyz;

USES dos;

VAR OldInt08 : procedure;
    name : string;

{$F+}

PROCEDURE NewInt08; interrupt;
BEGIN
{ Do display ticker-tape message on screen }
ASM pushf END;
OldInt08;
END;

{$F-}

BEGIN
getintvec($8,@OldInt08);
setintvec($8,@NewInt08);
write('What''s your name? ');
readln(name);
setintvec($8,@OldInt08);
END.

Hope to have helped,

   Basti

--
-----------------------------------------------------------------------
       Bastisoft      101674.2...@compuserve.com

       Fleestedt, Germany
-----------------------------------------------------------------------

Other Threads