` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

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 November 23, 2024, 2:07 am
This article has been viewed 35212 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: