Reference Numbers

Each message in each drawer of your mailbox has a reference number. Reference numbers in each drawer begin at 1 and go up sequentially. Thus your mailbox will have three messages with the number 1: the first Saved message, the first Unread message, and the first Outbound message.

During an interactive MAIL8 session, messages are often deleted from drawers. For example, when you read a new mail message, MAIL8 deletes the unread message notification from the Unread drawer. When a message is deleted, the other messages are not immediately renumbered.

For example, if you delete message 1 in a drawer, the other messages keep their current numbers. Messages are only renumbered if you ask to have them renumbered (see the description of the Number command in "expl mail number"). When the messages in a drawer are renumbered, they stay in the same order but their reference numbers are changed to run sequentially from 1.

In every drawer, numbers are assigned to messages in increasing order, as the messages are added to the drawers. For example, suppose the last message put in the Saved drawer was number 4. Then the next is number 5, even if some or all of the messages in the drawer are deleted in the meantime. Numbers keep going up sequentially until the next time you renumber.

If all the messages in the Saved or Unread drawer are deleted, the current message pointer is set to 1, even though there isn't really a message 1 in the drawer. If all the messages in the Outbound drawer are deleted, the current message pointer refers to the message most recently sent, even if that is no longer in the mailbox.

Referring to Messages

The reference number is the simplest way to refer to a message in a drawer. For example, you can display Outbound message 6 with the command

          6 print +outbound

MAIL8 offers several other ways to reference messages. These are listed below. In these descriptions, N always stands for an unsigned number (integer).

+
refers to the message that follows the current message in a drawer. MAIL8 skips deleted messages. Thus if the current message is 5 and message 6 has been deleted, + goes to message 7 (or whatever comes next).
+N
refers to the Nth message after the current message in a drawer. As with +, deleted messages are skipped.
-
goes back one message. As with +, deleted messages are skipped.
-N
goes back N messages. Deleted messages are skipped.
^
goes back one message (same as -1).
.
is a special symbol referring to the current message in the drawer.
#
is a special symbol referring to the first message in the drawer.
$
is a special symbol referring to the last message in the drawer.
*
is a special symbol referring to all the messages in the drawer. In other words, it is equivalent to #,$ (see "Message Ranges" below).
/string/
can be used in any drawer. It refers to the next message whose address or subject line contains the given string. For example,
        /smith/

searches for a message with smith somewhere in the sender's address or in the subject. The match can be found anywhere in the address (in earlier versions of MAIL8, the match had to come at the beginning of the address). The search for the matching userid begins with the message immediately following the current message and continues to the end of the drawer. If a matching userid has not been found by that time, the search wraps around to the top of the drawer and continues from there until it gets back to where it started. If no match is found, MAIL8 gives you an error message.

The given string may contain any or all of the pattern-matching characters recognized by the TSS LOCATE command. For example,

        /Bull.*HN/

searches for an address or subject that contains "Bull" followed by zero or more characters, followed by "HN". The special meaning of pattern-matching characters can be turned off by putting a backslash "\" in front of them. For more on pattern-matching, see "expl locate".

?string?
can be used in any drawer. It is just like /string/ except that the search goes backward instead of forward. If MAIL8 gets to the top of the drawer and hasn't yet found a match, the search wraps around to the last message in the drawer and continues backward.
//
is a short form for /string/. MAIL8 searches for the last string that was mentioned in a /string/ or ?string? reference.
??
is a short form for ?string?. MAIL8 searches backward for the last string that was mentioned in a /string/ or ?string? reference.
ref+N
consists of any sort of message reference "ref", a plus sign "+", and an integer N. This refers to the Nth message after the one indicated by "ref". For example,
        /name/+1

refers to the message after /name/}.

ref-N
is similar to ref+N, but refers to the Nth message before the one indicated by "ref".
ref/string/
goes to the message indicated by "ref", then starts searching forward for string in a subject or sender's address. The forms ref//, ref?string?, and ref?? are also recognized and work as you would expect.

If you try to refer to a message that is not in the drawer, MAIL8 gives you an error message. For example, you can't use the reference number 35 if there is no message 35 in the drawer.

Note that +N and -N references do not "wrap around". For example, if you are at the last message in a drawer and try +1, MAIL8 gives you an error message.

Message Ranges:

Some commands may be applied to more than one message at a time. For example, one Print command can display several consecutive messages. To do this, you specify a range of messages to which the command should be applied. You specify a message range by giving the first and last message numbers in the range, separated by a comma, as in

          3,5 print

which displays messages 3 through 5. You may use the reference symbols given in the previous section in place of numbers. For example,

          3,$ print

displays every message from number 3 to the end of the drawer.

          #,. delete

deletes messages in the drawer, from the first message to the current one.

The special symbol "*" stands for every message in a particular drawer. For example,

          * print +unread

displays every Unread message.

Copyright © 1997, Thinkage Ltd.