AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Realtime Input? Thread?

Ein Thema von sk.Silvia · begonnen am 13. Mai 2006 · letzter Beitrag vom 14. Mai 2006
 
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#14

Re: Realtime Input? Thread?

  Alt 14. Mai 2006, 13:32
I still don't know why you want to do this with a thread, if you mind looking at my post above.

But if, this is how to do it:

- place the query (or whatever fetches the input form the user) in a thread
- after the query was answered and confirmed by the user, the thread sets a variable "I'm done", places the user input somewhere the main thread has access to and goes asleep/terminates

- in your main thread, you use MSDN-Library durchsuchenwaitforsingleobject to wait until the thread does set this variable, fetch the input and continue your loop.

But unless you have to keep your app doing something else while waiting for the input (which wouldn't work the way I just described it), i don't know why you would want to use a thread here...

EDIT: you don't initialize your "i" in the thread, so it'll probably take a long time until it gets to "3". but I can't see any othermistakes in it.
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz