xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET BACKGROUND TASKS

Enables or disables the activity of background tasks.

Syntax

SET BACKGROUND TASKS on | OFF | (<lOnOff>)

Arguments

on | OFF | (<lOnOff>)
The option toggles the activity of background tasks defined with function HB_BackGroundAdd(). With ON or .T. (true), background task processing is enabled. OFF or .F. (false), which is the default, disable the activity of background tasks.

Description

SET BACKGROUND TASKS toggles the activity of background task processing. Backgound tasks are defined with function HB_BackGroundAdd() and run concurrently to regular program routines. Use function HB_IdleAdd() to process concurrent tasks during idle states only.

To enable background task processing, SET BACKGROUND TASKS must be set to ON.

Info

See also:HB_BackGroundAdd(), Set(), SET BACKGROUNDTICK
Category: Background processing , SET commands , xHarbour extensions
Source:rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates how the time can be displayed
// continuously while MemoEdit() is active.

   PROCEDURE Main
      LOCAL nTask

      HB_IdleAdd( {|| HB_BackGroundRun() } )

      nTask := HB_BackGroundAdd( {|| ShowTime( MaxRow(), MaxCol()-7 ) }, 1000 )

      SET BACKGROUND TASKS ON

      MemoEdit( MemoRead( "Test.prg" ), 1, 0, MaxRow()-2, MaxCol() )

      HB_BackGroundDel( nTask )
   RETURN


   PROCEDURE ShowTime( nRow, nCol )
      DispoutAt( nRow, nCol, Time() )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe