ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Various properties
  • 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.
// --Evénement "Initialisation" de la fenêtre
// Dans le code d'initialisation de la fenêtre, lancer uniquement le thread
ThreadExecute("test", threadNormal, TraitementsDeFichiers)
// -- Evénement "Clic" sur le champ Bouton BTN_Ajouter 
// Code d'ajout (permet de relancer le test)
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
// -- Evénement "Clic" sur le champ Bouton BTN_Arrêter
// Code d'arrêt (pour contrôler le moment de l'arrêt dans l'exemple)
gFilesnames.AjoutTerminé = True
// Procédure du thread (avec une trace à la fin)
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")
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/13/2025

Send a report | Local help