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 run the test of 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 Add button field (BTN_Add): only file traces are displayed. The end trace is not displayed.
  • Click once again on the Add button field (BTN_Add): only file traces are displayed. The end trace is still not displayed.
  • Click on the End button field (BTN_Stop): the end trace is displayed (thread stops).
  • Click on the add button field (BTN_Ajout): nothing happens. This operating mode is normal because the thread is stopped.
// -- Initialization event of the window
// In the initialization code of the window, start the thread only
ThreadExecute("test", threadNormal, FileProcesses)
// -- "Click" event of the BTN_Add control 
// Addition code (used to restart the test)
sFileList is string = fListFile("c:\temp\*.*", frNotRecursive)
stAFile is STFile
gFilesnames.AdditionCompleted = False
FOR EACH STRING sAFile OF sFileList SEPARATED BY CR
	stAFile.sPath = sAFile
	stAFile.sFileName = fExtractPath(sAFile, fFileName + fExtension)
	Push(gFilesnames, stAFile)
END
// -- "Click" event of the BTN_Stop control
// Stop code (to control the stop in the example)
gFilesnames.AdditionCompleted = True
// Procedure of the thread (with a trace at the end)
PROCEDURE FileProcesses()
stTemp is STFile
tt is boolean

tt = Pop(gFilesnames, stTemp, WaitIfEmpty)
WHILE tt
Trace(stTemp.sFileName)
tt = Pop(gFilesnames, stTemp, WaitIfEmpty)
END
Trace("end")
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/05/2024

Send a report | Local help