Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 5:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Line breaks in text variables?
PostPosted: October 17th, 2006, 9:48 am 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
Hi, I have a text field in which different texts are displayed. I put the texts into a variable which is displayed within the field.

Currently the text is displayed whithout any line breaks. How can I put line breaks into a text variable? Are there any special characters to create a line break?

Thanks in advance.

T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
 Post subject:
PostPosted: October 17th, 2006, 12:35 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
\n will give you a line break.
\t will give you a tab.

So you would put your expression together like
Code:
VAR1+"\n"+VAR2+"\n"+VAR3

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: October 18th, 2006, 2:03 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
bwpatric, thank you very much for help.

Unfortunately this was not exactly what I want to do.

What I want to do is to put a line break into a text which is stored within a variable.

For example I set the text variable X to "Hello, this is a sample text"

I wonder how I can set a line break into this text. E.g.: "Hello, this is LINEBREAK a sample text.

I would very appreciate if you or someone else has a hint for me.


T.

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
 Post subject:
PostPosted: October 18th, 2006, 2:41 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
Get the variable's contents and then split it with a space.
Code:
var stuff=textbr.split(" ");


Then rejoin everything with a hard return included.
Code:
textbr=stuff[0]+ " " + stuff[1]+"\n"+stuff[2]+ " " + stuff[3]+ " " +stuff[4]+ " " +stuff[5];


Or you could also try substring, if you want the hard line return to after a specific piece of text.

Code:
var stuff=textbr.substring(0,14);
var stuff1=textbr.substring(15,textbr.length);
textbr=stuff+"\n"+stuff1;



I'm sure there are many other ways to attempt this as well and probably someone else can do it much more elegantly than what I've suggested, but this should at least get you thinking about it.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: October 18th, 2006, 2:55 pm 
Offline

Joined: November 8th, 2004, 5:23 pm
Posts: 279
Opus: Opus Pro 9
OS: Win 10/64
thank you very much. I will try it this way.

T. :D

_________________
Opus Pro 9.75, Win 10/64, 8 GB RAM, Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 CPUs), ~3.4GHz, NVIDIA GeForce GTX 660 Ti, Roland OctaCapture


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 96 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group