Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWTxt2Array

FWTxt2Array(cString,[nSize],[lBreak]) -> aReturn

Splits text into lines while respecting words.

FWTxt2ArrayAdvPL
01 · OVERVIEW

Overview

cString contains text and nSize limits generated line length. lBreak controls original CRLF handling, but the official table inconsistently labels it Array of Record. To avoid relying on this editorial error, the example only uses text and width. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWTxt2Array(cString,[nSize],[lBreak]) -> aReturn

Parameters

cString
CharacterRequired

Input text.

nSize
NumericOptional

Maximum width.

Return value

Character array.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed453()
    Local aLines := FWTxt2Array("ALFA BETA GAMA",9)
    Local nI
    // Display each generated line.
    For nI := 1 To Len(aLines)
        ConOut(aLines[nI])
    Next
Return Nil
Expected result

Displays lines resulting from word-aware splitting. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Test overlong words, CRLF and accents using the deployed encoding.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWTxt2Array. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha