# GetCharFromLine Method

> Returns the character position of the first character of the line with the given zero-based index, counted from the start of the text; -1 if it doesn't exist.

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

---

Returns the position of a line's first character. The first character's position is the number of characters from the beginning of the text to the beginning of the specified line. The first character's position of the first line is zero.

### Syntax

```vbscript
TXTextControl.GetCharFromLine Line
```

### Parameters

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

### Return Value

The method returns the requested character position. It is -1 if an error has occurred or if the specified line does not exist.

### Data Types

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

### See Also

- [GetLineCount Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinecount-method/llms-full.txt)
- [GetLineFromChar Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getlinefromchar-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:** [GetCaretRect Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcaretrect-method/llms-full.txt)
- **Next:** [GetCharRect Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/getcharrect-method/llms-full.txt)
