Blitz3D+ Command Reference

TextAreaLineLen ( textarea,line )

Parameters

textarea - text area gadget

line - line number, starting at 0

Description

Returns the length of one line of a text area, in characters.

Requires Extended language mode.

Measures a single line, counting whole Unicode characters. Together with TextAreaChar (where the line starts) it describes the line as a range you can hand to the range commands - grab it with TextAreaText, replace it with SetTextAreaText, or colour it with FormatTextAreaText:

start=TextAreaChar(area,line)
lineText$=TextAreaText(area,start,TextAreaLineLen(area,line))

(For whole lines, units 2 does the same job more directly: TextAreaText(area,line,1,2).)

The count includes the line's terminating carriage return - every line except the last has one, so the last visible character of "abc" plus a break is counted as 4. Out-of-range line numbers return 0.

The tree and text area sample shows the text area family working together.

See also: TextAreaChar, TextAreaLine, TextAreaLen, TextAreaText.

Index