basic.rollback.work Statement/BASIC Program

basic.rollback.work

Command basic.rollback.work Statement/BASIC Program
Applicable release versions: AP 6.2
Category BASIC Program (486)
Description Rolls back (or undoes) a transaction

This operation atomically undoes all updates made since the last "begin work" command. All locks acquired within the transaction are released.
Syntax rollback {work|transaction} {then | else statement.block}
Options
Example
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"
end
Purpose
Related basic.begin.work
basic.commit.transaction
basic.transaction.commit
basic.rollback.transaction
basic.transaction.rollback
basic.transaction.abort
cfunc.trans