Hello!
I have a problem with
ThreadExecute.
ThreadExecute works, no doubt, but if I'm working in a thread, with hyper file commands like
hreadfirst or
hmodify then I have several times, on slow machines the index (.ndx) corrupt on classic hyperfile. Can someone help me? Is
Multitask(-1) or
MultitaskRedraw(Window) a problem?
This is my code (shortend):
in Main (initialization of window):
ThreadMode(threadCriticalSection)
ThreadExecute("MAINLOOP",threadUseHyperFile,TimerMain)
ThreadWaitSignal(Infinite)
In TimerMain:
ThreadListe is int
ThreadSendSignal(".")
LOOP
ThreadWaitSignal(300)
IF ThreadState("TMR")=threadRunning THEN
ThreadListe=BinaryOR(ThreadListe,1)
END
IF ThreadListe=0 THEN
ThreadExecute("SENDEN",threadUseHyperFile,SendenEmpfangen)
END
END
SendenEmpfangen (Send/Receive):
HReadSeek("XXX_","KEY",1)
IF HFound("XXX_") THEN
HCopyRecord("XXX_",XXX)
HModify("XXX_")
RESULT False
ELSE
HCopyRecord("XXX_",XXX)
HAdd("XXX_")
RESULT True
END