DispCount

DispCount

Return the number of pending DispEnd() requests

Syntax

      DispCount() --> nDispCount
     

Returns

DispCount() returns the number of DispEnd() calls required to restore the original display context.

Description

You can use DispCount() to determine the current display context. Harbour uses display contexts to buffer and to supervise screen output operations.

Each call to DispBegin() defines a new display context. Output to the display context is suppressed until a matching DispEnd() statement executes.

Since you may nest DispBegin() calls, use DispCount() to determine whether there are pending screen refresh requests.

Examples

      .  This example saves the setting of DispCount(), then releases
      all pending display contexts before writing to the screen:
      
      PROCEDURE ForceDisplay(cExp)
         LOCAL nSavCount
         
         nSavCount := DispCount()
         
         //  Discard pending display contexts
         DO WHILE ( DispCount() > 0)
            DispEnd()
         ENDDO
         
         DispOut(cExp)
         
         //  "Rewind" the current display context
         DO WHILE (DispCount() < nSavCount )
            DispBegin()
         ENDDO
      RETURN
     

Seealso

DispBegin(), DispEnd()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s