Blitz3D+ Command Reference

TextAreaLen ( textarea[,units] )

Parameters

textarea - text area gadget

units (optional) - what to count:
1: characters (default)
2: lines

Description

Returns the length of a text area's text, in characters or lines.

Requires Extended language mode.

Character units count whole Unicode characters - an accented letter or an emoji is one character, not several bytes - with each line break counting as one character (a carriage return). Line units count display lines; note that an empty text area still reports one (empty) line, while its character count is 0.

The classic uses: iterating lines with a For loop up to TextAreaLen(area,2)-1, or grabbing everything with TextAreaText using the default full range.

See also: TextAreaText, TextAreaLineLen, TextAreaCursor, SetTextAreaText.

Index