oi10:presentation_server:yield

Yield subroutine

Allows the Presentation Server to check and execute all pending events in the Windows Message Queue, returning when the queue is empty. This allows the system to remain responsive during a long running process.

Call Yield( SaveVars )

NameRequiredDescription
SaveVarsNoIf TRUE$ (1) then the following system variables will be saved and then restored after the Yield operation:


* @Dict
* @Record
* @ID
* @RecCount
* @Rn_Counter



The state of Select Cursor 0 will also be saved (via the Push_Select/Pop_Select functions)

N/A

N/A

Calling the Yield function during a long-running process is important for several reasons:

- It allows screen updates, so that changes to controls can be displayed. - It allows other events to fire so that the user interface remains responsive. - It allows Windows to determine that the process is not "dead" so it will refrain from displaying a "ghost" window with the "Not Responding" caption.

The Yield function is designed to be used from within "Event Context". If called outside of this context it calls the WinYield() function instead.

 
$Insert Logical

   

   Ctr = 0

   Eof = FALSE$

   

   Loop

      ReadNext ID Else Eof = TRUE$

   Until Eof

      

      Ctr += 1

      

      // Update the progress bar

      Call Set_Property_Only( @Window : ".PRB_GASGUAGE", "VALUE", Ctr )

      

      // Allow the progress bar to update and save the

      // select state while we do this

      Call Yield( TRUE$ )

      

      // Check that the window is still up because the

      // user could have closed it during the Yield()

      

   While ( Get_Property( @Window, "HANDLE" ) )

      

      // Do processing etc ...

      

   Repeat
 
 
 

Get_Property, Set_Property, Appendix A - Concatenating Properties.

  • oi10/presentation_server/yield.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1