www.icetips.com  Icetips Utilities Documentation 2/26/2010    

Thread Limit Class: AddProcedure

Previous  Top  Next  


Prototype: ( WINDOW pWin),BYTE

 

pWinReference to the procedure window

 

ReturnsIf the procedure was added successfully the method returns True.  If the procedure hit the MaxRuns limit, the method returns False.

 

This method attempts to add the procedure to the class.  If it fails then the procedure limit has been reached - this will normally never happen as that is taken care of by the CheckProcedure method.  This method also registers the CloseWindowHandler method to clean up when the window closes.  The template generate the call to this method into the WindowManager.Init method at priority 8005 so it is executed just after the window is opened as it needs the handle to the window to save it in case it needs to be activated when the procedure hits the MaxRuns limit. 

 

Example:

ITThreadLocal  Class(ITThreadLimitClass)

TakeLimit        Procedure,VIRTUAL

              End

 

ThisWindow.Run  PROCEDURE

Code 

ITThreadLocal.Init('Browsepeople')

ITThreadLocal.SetProcedureLimit(1)

If Not ITThreadLocal.CheckProcedure(ITThreadLimit)

  Return LEVEL:Fatal

End

ReturnValue = PARENT.Run()

RETURN ReturnValue

 

 

ThisWindow.Init PROCEDURE

Code

If Not ITThreadLocal.AddProcedure(QuickWindow)

  Return LEVEL:Fatal

End

 

 

See also:

 

AddProcedure

CheckProcedure

RemoveProcedure (Global class)

RemoveProcedure (This class)



Direct link to this page: http://www.icetips.com/manuals/utilities/addprocedure_threadlimit.htm