<< Click to display table of contents >> TRVChat.GetMessageItemNo, GetMessageTextItemNo |
GetMessageItemNo returns the index of the first item in the ChatRichView document that represents the given message.
GetMessageItemTextNo returns the index of the first item in the ChatRichView document that represents text of the given message.
function GetMessageItemNo(Msg: TRVChatMessage;
StartItemNo: Integer = 0): Integer;
function GetMessageItemNo(MessageIndex: Integer;
StartItemNo: Integer = 0): Integer;
function GetMessageTextItemNo(Msg: TRVChatMessage;
StartItemNo: Integer = 0): Integer;
function GetMessageTextItemNo(MessageIndex: Integer;
StartItemNo: Integer = 0): Integer;
Parameters
The message is specified either by Msg parameter (a reference to one of the items in the Messages collection) or by the MessageIndex parameter (an index of item in Messages).
The component searches for the message in ChatRichView, enumerating items starting from StartItemNo. By default, StartItemNo = 0, so it searches for this message from the beginning. If you know an index of item of one of previous messages, you can pass it in StartItemNo parameter to increase efficiency. If the message is not found, the methods return -1.
Each message is represented by a single paragraph. It may have the following sections (any of them are optional):
▪user name
▪quote / attached files / image
▪message text
Each message may have line breaks, but cannot have paragraph breaks.
GetMessageItemTextNo returns the index of the first item in the message text section, or -1 if the message does not have text.
The opposite method to GetMessageItemNo is GetMessage.