Viva Clipper !

COMMIT

Advertisements

COMMIT

Perform a solid-disk write for all active work areas

Syntax

      COMMIT

Description

COMMIT is a database command that flushes Harbour buffers and performs a solid-disk write for all work areas with open database and index files. The solid-disk write capability is available under DOS version 3.3 and above. Under DOS 3.2 or less, COMMIT flushes Harbour buffers to DOS.

In a network environment, issuing a GO TO RECNO() or a SKIP0 will flush Clipper’s database and index buffers, but only a COMMIT will flush the buffers and perform a solid-disk write. Thus to insure updates are visible to other processes, you must issue a COMMIT after all database update commands (e.g., APPEND, REPLACE). To insure data integrity, COMMIT should be issued before an UNLOCK operation. Refer to the “Network Programming” chapter for more information on update visibility.

Examples

      .  In this example, COMMIT forces a write to disk after a series
        of memory variables are assigned to field variables:
      USE Sales EXCLUSIVE NEW
      MEMVAR->Name := Sales->Name
      MEMVAR->Amount := Sales->Amount
      //
      @ 10, 10 GET MEMVAR->Name
      @ 11, 10 GET MEMVAR->Amount
      READ
      //
      IF UPDATED()
         APPEND BLANK
         REPLACE Sales->Name WITH MEMVAR->Name
         REPLACE Sales->Amount WITH MEMVAR->Amount
         COMMIT
       ENDIF

Seealso

DBCOMMIT(), DBCOMMITALL(), GO, SKIP

Advertisements

Advertisements