# GetLineFromChar Method

> Returns the zero-based index of the line that contains the character at the specified zero-based character position, or -1 if the position does not exist.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > GetLineFromChar Method
- **243 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-method/llms-full.txt

---

Returns the index of the line which contains the character with the specified character position.

### Syntax

```vbscript
TXTextControl.GetLineFromChar Char
```

### Parameters

| Parameter | Description |
|---|---|
| Char | Specifies the position of the character whose line index is returned. The position of the first character is zero. |

### Return Value

The method returns a line index, starting with 0 for the first line. The return value is -1 if an error has occurred or if the specified character position does not exist.

### Data Types

| Name | Data type |
|---|---|
| Char | Long |
| Return value | Long |

### See Also

- [GetLineCount Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt)
- [GetCharFromLine Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharfromline-method/llms-full.txt)
- [GetLineFromPoint Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefrompoint-method/llms-full.txt)
- [Programming Category: Line and Character Operations](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/line-character/llms-full.txt)

---

## Nearby

- **Previous:** [GetLineCount Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt)
- **Next:** [GetLineFromPoint Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefrompoint-method/llms-full.txt)
