Function DispBegin() Foundation

Initiates the buffering of screen output.

Syntax
DispBegin() --> NIL
Return

The return value of DispBegin() is always NIL.

Description

DispBegin() starts the buffering of screen output. Display is suppressed and temporarily stored until the function DispEnd() is called. After DispEnd() the buffers are displayed on the screen. When an Xbase++ application runs in a window, the buffering extends only to the active window and not the entire screen.

DispBegin() is always used with DispEnd(). A display on the screen is held in a buffer until the buffer is released with DispEnd(). This allows accelerated screen updating, especially with complex screen output.

For normal display operations the functions DispBegin() / DispEnd() are not needed. Their use is optional.

Calls to the function DispBegin() can be nested. If DispBegin() is called before the function DispEnd(), the internal counter of the function DispCount() is incremented. Buffered screen output occurs until a corresponding number of DispEnd() calls are made. Only then is the output visible on the screen.

Examples
Buffered display of a box

// In this example a box is displayed on the screen. 
// Then a second box is output several times on the 
// screen with a buffered display. This creates the 
// impression that the second box is moving "behind" 
// the first across the screen. 

PROCEDURE Main 
   LOCAL cScreen, nTop:= 0, nLeft:= 0, nBottom:= 10, nRight:= 50 

   CLS 
   DispBox(7,10,17,60,1,"W+/BG")     // display first box 

   DO WHILE nTop < MaxRow() 
      DispBegin()                    // start screen buffering 

      cScreen := SaveScreen(7,10,17,60)  // save first box 
                                     // display second box 
      DispBox(nTop,nLeft,nBottom,nRight,2,"W+/B") 
      RestScreen(7,10,17,60,cScreen) // restore first box 

      DispEnd()                      // display screen buffer 

      Sleep(10)                      // wait a moment 

      DispBegin()                    // start screen buffering 
                                     // delete second box 
      Scroll(nTop, nLeft, nBottom, nRight) 
      RestScreen(7,10,17,60,cScreen) // restore first box 

      DispEnd()                      // display screen buffer 
                                     // specify new coordinates 
      nTop++ ; nLeft++ ; nBottom++ ; nRight++ 
   ENDDO 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.