10-03-2022, 01:07 AM
(This post was last modified: 10-03-2022, 02:27 AM by TerryRitchie.)
(10-03-2022, 12:49 AM)mnrvovrfc Wrote: Thank you for this. However, "Action" is not necessary and in fact produces confusion. To actually get lines must set it to zero, so why even need this parameter? For more serious work (eg. include into a simple word processor) check for hyphenated words as well as spaces to split lines.
Oh sure, the action parameter was added for my library needs. Strip the action code out if all you need is a simple parser with the ability to report one line at time during subsequent calls.
The library I'm writing has the need for number of lines to be reported. Pretty handy.
Here's an example use:
t$ = "big long crazy text string here. blah blah blah blah ... and blah"
FOR x=1 TO VAL(ParseText$(t$, 40, 1))
Array(x).text = ParseText$(t$, 40, 0)
NEXT x
Or in my library's case I need to know the number of lines the text will be placed in to size ASCII text box windows appropriately.
Box(Index).height = VAL(ParseText$(t$, 40, 1)) + 4 ' top border + header text + header line delimiter + border bottom + lines of text
'Then, as the box is drawn lines of parsed text can be brought in one at time as needed
"as well as spaces to split lines"
It does do that.