Equinox Online Help - Language Reference - A to Z

Home

MarkIndex

Applies to
SyntaxMarkIndex IndexName [,UserLoginNameExpression]
Action[Statement] Adds the current record to a query index.
ScopeUsable anywhere.
Notes

This statement adds a reference to the current record to IndexName, where IndexName specifies a query index. If the UserLoginNameExpression is supplied, the index instance for that user is marked, rather than the one for the current user. This powerful feature allows different user record sets on the same index to be manipulated under program control. eg Workflow systems could pass tasks between members of a group.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

Returns SysError = 1 if the user specified is not found.

CategoryIndexes
See Also BlankIndex, CopyIndex, CurrentIndex, GroupSetIndex, IndexFromName, IndexLastUsed, IsDuplicate, KeyValues, MakeKey, ModifyIndex, NameFromIndex, SetExecuteIndex, SetIndex, UnmarkIndex, UpdateIndex
Example

This method determines if there is a contact name for a customer. If not, then it adds the customer record to an index used by the tele-sales staff, so that a telephone call can be made to find one.

If MainContact = "" Then MarkIndex nocontact

This method marks the current record in the Supervisor's audit trail if the Salary field is changed.

If FieldChanged(Salary) Then MarkIndex AuditIndex, "Equinox"

The next method sets up three separate indexes for customers with unpaid invoices more than one, two, or three months old. The method examines each customer's invoices in reverse date order. If it finds an unpaid invoice, then the customer's record is added to the appropriate index.

The method uses two fields: InvoicePaid (a logical value) and InvoiceDate. One index is used, InvoiceDate, which is a child index.

logical marked1, marked2, marked3
number DebtorDays

BlankIndex debtors1
BlankIndex debtors2
BlankIndex debtors3

subtable customer
SetIndex DefaultIndex
FirstRecord

while not syserror | Repeat for every customer
marked1 = false
marked2 = false
marked3 = false

Subtable invoice
SetIndex IinvoiceDate
LastRecord

while not syserror | Repeat for every invoice
if not InvoicePaid then
DebtorDays = Today - InvoiceDate

| Mark an index unless already done
switch DebtorDays
case < 30 | 0-1 Month (no action)

case < 60 | 1-2 Months
if not marked1 then
MarkIndex debtors1
marked1 = true
end if
case < 90 | 2-3 Months
if not marked2 then
MarkIndex debtors2
marked2 = true
end if
default | More than 3 Months
if not marked3 then
MarkIndex debtors3
marked3 = true
end if
end switch
end if

| If the last unpaid invoice was more than 3 months old, there's no point in continuing
if marked3 then exit subtable
PreviousRecord
end while | More invoices
end subtable | Invoice
NextRecord | Next customer
end while | More customers
end subtable | Customer