AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Propiedades WLanguage / Propiedades varias
  • 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")
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 05/12/2024

Señalar un error o enviar una sugerencia | Ayuda local