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 not break text

Author
Message
rikkatsuki
14
Years of Service
User Offline
Joined: 10th Dec 2011
Location:
Posted: 11th Dec 2011 02:48 Edited at: 11th Dec 2011 04:40
First off I want to introduce myself. I just started darkbasic for a few days and it's actually my first programming language. so basically I made a few codes about making text box, but I got stuck here because this code



I could create like in an adv text box, but I don't know how to make it to not to break each word. Can someone give me pointers how to make it not to break each word?
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 11th Dec 2011 15:39
so you want to read each word, better use string tokenizing.

a$=first token(string$, token$) `in your case token$=" ".
a$=next token$(string$)
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Dec 2011 16:14
You could use IanM's split string command to split the text by spaces, then append each word together until it exceeds the textbox width, then subtract that word, move onto the next line and continue.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-10 21:17:33
Your offset time is: 2026-07-10 21:17:33