LineCollection Object
Description
The LineCollection object contains all text lines in a Text Control document or part of the document.
Syntax
LineCollectionExamples
The following example demonstrates LineCollection in a practical document-editing workflow. The LineCollection object contains all text lines in a Text Control document or part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectLineCollection(lines) {
lines.getItem(
function(result) {
if (!result) {
console.warn("No line was returned.");
return;
}
console.log("get item result:", result);
},
-1,
onTxError
);
}Members
Methods
| Method | Description |
|---|---|
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets a particular line from the collection. |
| getItemAtLocation | Gets the line at a certain geometrical position. |