|
|
|
|
|
- Usage example of the AdditionCompleted property
AdditionCompleted (Example)
Usage example of the AdditionCompleted property To implement this example: - Create a window. Enter the WLanguage code in the window initialization event.
- Create a Button control ("BTN_Add"). Write the WLanguage code in the "Click" event of the control.
- Create a Button control ("BTN_Stop"). Write the WLanguage code in the "Click" event of the control.
- Create and type the thread procedure.
To test this example: - Show window: thread starts, nothing happens. This operating mode is normal because the thread waits if the stack is empty.
- Click on the Button control field (BTN_Ajout): only file traces are displayed. The end trace is not displayed.
- Click once again on the Button control for adding (BTN_Ajout): only file traces are displayed. The end trace is still not displayed.
- Click on the Button control field (BTN_Stop): the end trace is displayed (the thread stops).
- Click on the add button field (BTN_Ajout): nothing happens. This operating mode is normal because the thread is stopped.
ThreadExecute("test", threadNormal, TraitementsDeFichiers)
sListfic is string = fListFile("c:\temp\*.*", frNotRecursive)
stUnFic is STFile
gFilesnames.AjoutTerminé = False
FOR EACH STRING sUnfic OF sListfic SEPARATED BY CR
stUnFic.sChemin = sUnfic
stUnFic.sNomfic = fExtractPath(sUnfic, fFile + fExtension)
Push(gFilesnames, stUnFic)
END
gFilesnames.AjoutTerminé = True
PROCEDURE TraitementsDeFichiers()
stTemp is STFile
tt is boolean
tt = Pop(gFilesnames, stTemp, WaitIfEmpty)
WHILE tt
Trace(stTemp.sNomfic)
tt = Pop(gFilesnames, stTemp, WaitIfEmpty)
END
Trace("fin")
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|