TEXAREA wordwrap

new BookmarkLockedFalling
donnybowers
Junior Member
**

donnybowers Avatar

My website was created in the mid 2000s. Unfortunately I lost the code somehow.
Posts: 70Male

Any code I share on this forum is released to the public domain and may be used freely any way you like unless for some reason I specifically indicate otherwise in the post.
metro
Full Member
***

metro Avatar

Posts: 207

Post by metro on Jan 6, 2019 17:56:20 GMT -5

From the Wiki....
[start]
cls
textarea #ta, ""
'two print statements but both print to same line
#ta print("Run";chr$(32))
#ta print("BASIC (two words on same line)")
'force a new line on browser page for the link
print ""
link #cnt,"Continue",[cont]
wait
[cont]
gosub [refresh]
'println() method appends a CR/LF
#ta println("")
#ta println("CR/LF appended to this one")
'print blank line CR/LF only
#ta println("")
#ta println("New line")
'print() method has no CR/LF
#ta print("Another new line")
'force a new line on browser page for the link
print " "
link #nxt, "Next", [next]
print " "
wait

[next]
gosub [refresh]
print " "
print "Contents of Textarea is: "
print text$
print " "
link #clr, "Clear textarea", [clearTa]
wait

[clearTa]
'text() method replaces all text with quoted string, in this case an empty string
#ta text("")
print " "
link #res, "Restart", [start]
wait

[refresh]
'get the contents of textarea into a string
text$ = #ta contents$()
'clear the page
cls
'create the textarea and fill with text$
textarea #ta, text$
return

As there is no 64 bit linux version of RB and the 32bit will not run on a 64bit OS I have no way of testing println
I do know that I have to append EOL$= chr$(13)+chr$(10) using a texteditor in Libertybasic
Last Edit: Jan 6, 2019 17:57:09 GMT -5 by metro
Intel Core2 QUAD CPU @2.54 x 4 Mint Linux 19.3 Mate