| |
|
|
p.specht
| Thread- nProcs can end a Return-worth supplying. i'm mere not clear, How one whom in the Hauptprogramm ausliest. gives it there a simple Possibility?
demonstration with 3 gesteuerten Threads:
{$cleqt}
Windowstyle 24
cls rgb(255,200,200)
var edit& =@Create("Edit",%Hwnd,"1",40,20, 140,20)
var edit2&=@Create("Edit",%Hwnd,"2",40,50, 140,20)
var edit3&=@Create("Edit",%Hwnd,"3",40,80, 140,20)
var thread& =thread.start(procaddr(meinThread), edit&, "1000")
var thread2&=thread.start(procaddr(meinZweiterThread), edit2&, "2000")
var thread3&=thread.start(procaddr(meinDritterThread), edit3&, "3000")
var n&=0
font 2
locate 15,1
Print " Theads go the row to exits through ESC-Button!"
Print "\n Hauptprogramm now in Hauptschleife!"
repeat
locate 23,23:print n&:inc n&
Window Title st$(n&)
waitinput 100
until (%key=27) or (%key=2)
print "\n Hauptschleife watts leave."
waitinput 1500
thread.stop(thread&)
while thread.is(thread&)
endwhile
thread.close(thread&)
print "\n have Thread Nr. 1 exits."
waitinput 1500
thread.stop(thread2&)
while thread.is(thread2&)
endwhile
thread.close(thread2&)
print " have Thread Nr. 2 exits."
waitinput 1500
thread.stop(thread3&)
while thread.is(thread3&)
endwhile
thread.close(thread3&)
print " have Thread Nr. 3 exits."
waitinput 1500
beep
print "\n here Hauptprogramm: Isch 'abe feddisch... BYEBYE!"
waitinput 3000
END
nproc meinThread :parameters thread&,dataLong&,dataString$
whilenot thread.message(thread&)==wm_close
settext(dataLong&,"["+time$(0)+"."+substr$(time$(1),1,".")+"]")
sleep(1000)
endwhile
return 0
endproc
nproc meinZweiterThread :parameters thread2&,dataLong2&,dataString2$
whilenot thread.message(thread2&)==wm_close
settext(dataLong2&, "("+time$(1)+"."+substr$(time$(0),1,".")+")")
sleep(1333)
endwhile
return 0
endproc
nproc meinDritterThread :parameters thread3&,dataLong3&,dataString3$
whilenot thread.message(thread3&)==wm_close
settext(dataLong3&, "{"+time$(0)+"."+substr$(time$(1),1,".")+"}")
sleep(3000)
endwhile
return 0
endproc
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11/25/18 ▲ |
|
|
|
|
p.specht
| evident there a Variante of Thread.Message in Hauptprogramm or. in the parents-Process. must only first draufkommen, How to the very abfrägt. If the already someone geschafft? |
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11/26/18 ▲ |
|
|
|
|
| if i remember rightly, then is thread& one 44 byte great memory -
The values to thread.message() for wParam, lParam stand in thread& on Offset 24, 28 and 32 but first if The function thread.message uses watts. before stand these 3 values on whom Pos. 12, 16, 20.
for geordnete communication with the Hauptschleife vlt. on the best Win32 SendMessage use.
now be I me nevertheless not sure, whether I so helped have. |
|
|
| |
|
|
|
p.specht
| thanks iF, werd´s try ... |
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11/27/18 ▲ |
|
|
|