rollback work statement

The rollback work statement rolls back (or undoes) a transaction.


rollback work {then|else statement.block}


This operation automatically undoes all updates made since the last begin work statement. All locks acquired within the transaction are released.


open "myfile" to f1
open "mylog" to f2
begin work
write total on f2,timedate();* create synchronized log
readu total from f1,"total"
if total = 0 then
   rollback work;* Cannot do anything
end else
   total = total - 1
   write total on f1,"total"
   commit work else print "Could not update"