` Closing all open windows (Randy Goodhew ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Closing all open windows
2000-05-31 -- Randy Goodhew
 
Here is a snippet of source code that allows you to post an event to all threads without having the overhead of creating a global queue and the code needed to manage that queue. ! PostAll(),LONG ! returns a count of all threads posted PostAll FUNCTION(LONG pEvent) Save:Thread LONG,AUTO ! save the thread J LONG,AUTO ! loop counter Result SHORT,AUTO ! count of active threads CODE Result = 0 ! blank the count Save:Thread = THREAD() ! save current thread LOOP J = 64 TO 1 BY -1 ! loop through threads SETTARGET(,J) ! attemp to set thread IF J = THREAD() ! test if thread exists Result += 1 ! increment count IF NOT OMITTED(1) ! count threads only, if event is omitted POST(pEvent,,J) ! post event END !if END !if END !loop SETTARGET(,Save:Thread) ! restore saved thread RETURN(Result)


Today is April 27, 2024, 4:33 pm
This article has been viewed 35112 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: