Synergex.SynergyDE.Select.CTInfo

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
namespace Synergex.SynergyDE.Select
class CTInfo

The CTInfo class retrieves change tracking information for a record.

Properties

CTInfo.Older

public Older

Implements a get method that returns a CTInfo object representing the previous revision of the record identified in the current CTInfo object, if one exists. (@CTInfo)

CTInfo.Newer

public Newer

Implements a get method that returns a CTInfo object representing the next revision of the record identified in the current CTInfo object, if one exists. (@CTInfo)

CTInfo.CTRecord

public CTRecord

Implements a get method that returns the record identified in the current CTInfo object. (a)

CTInfo.SnapshotNumber

public SnapshotNumber

Implements a get method that returns the change tracking snapshot number for the current CTInfo record. If the record doesn’t include change tracking data (i.e., CurrentCTState==Untracked) or if the record was added by an event that follows the last snapshot, SnapshotNumber returns 0. (int)

CTInfo.SnapshotTime

public SnapshotTime

Implements a get method that returns the change tracking snapshot time for the current CTInfo record entry in %DATETIME format. If the record doesn’t include change tracking data (i.e., CurrentCTState==Untracked) or if the record was added by an event that follows the last snapshot, SnapshotTime is blank. (a)

CTInfo.Rdlen

public Rdlen

Implements a get method that returns the %RDLEN of the current record. (int)

CTInfo.GetCTState

public GetCTState

Implements a get method that returns a CTState enumeration identifying the state of the current CTInfo record. (CTState)

Enumerations

CTState enumeration

The change tracking status:

Untracked

A record that has no recorded change history.

Insert

The initial record version.

Update

A modified record version.

Delete

A deleted record version.

ModifiedByDelete

A record version deleted in a later snapshot.

ModifiedByUpdate

A record version updated in a later snapshot.

Changed

ModifiedByDelete or ModifiedByUpdate.

PriorVersion

A record version with a known version in a prior snapshot.

The CTState enumeration values are bit values, and you’ll need to use bitwise operators in your comparison logic:

public enum CTState
    Untracked,          ^x(0000)
    Insert,             ^x(0001)
    Update,             ^x(0002)
    Delete,             ^x(0004)
    ModifiedByDelete,   ^x(0010)
    ModifiedByUpdate,   ^x(0020)
    Changed,            ^x(0030)
    PriorVersion,       ^x(0040)
endenum

Untracked, Insert, Update, and Delete are mutually exclusive, as are ModifiedByDelete and ModifiedByUpdate.

For example, in the following code, Insert reflects the record contents as they were first stored; Update reflects the record contents after they were updated; and Delete reflects the record contents as they were deleted. If an Insert or Update record includes the Changed enumeration (ModifiedByUpdate or ModifiedByDelete), an updated version or deletion of that record exists in a newer snapshot; otherwise that record is currently active.

ctstate = selenum.GetCTInfo.GetCTState
if (ctstate.band.CTState.Insert) then
    display(ttchn, "[Insert")
else if (ctstate.band.CTState.Delete) then
    display(ttchn, "[Delete")
else if (ctstate.band.CTState.Update) then
    display(ttchn, "[Update")
else
    display(ttchn, "[No Change data")
if (ctstate.band.CTState.ModifiedByDelete) then
    display(ttchn, ":ModifiedByDelete")
else if (ctstate.band.CTState.ModifiedByUpdate)
    display(ttchn, ":ModifiedByUpdate")
if (ctstate.band.CTState.PriorVersion)
    display(ttchn, ":PriorVersion")
if (.not.(int)(ctstate.band.CTState.Changed).and..not.(int)
&  (ctstate.band.CTState.Delete)) then
    writes(ttchn, ":Active]")
else
    writes(ttchn, "]")

See also

Change tracking and ctutl.