Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to WordWrap based on line length

Author
Message
Ace of Springs
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: Cambodia
Posted: 4th Mar 2012 04:21
Ok so I am trying to take a large body of text and split it into multiple lines, so each line has a max length of 20 characters. At the same time I need to keep individual words(separated by a space) in tact.

Example:

INTO


what is the best way to go about doing this?

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 4th Mar 2012 05:24 Edited at: 4th Mar 2012 05:25
you can use string tokenizing. look at the function I created for you:

Ace of Springs
14
Years of Service
User Offline
Joined: 10th Jan 2012
Location: Cambodia
Posted: 4th Mar 2012 06:32
Thank you very much, this is exactly what I needed.

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 4th Mar 2012 06:49
Happy to help

Login to post a reply

Server time is: 2026-07-10 10:20:26
Your offset time is: 2026-07-10 10:20:26