Line break in Text Variable

Oct 03, 2013

Hi,

is there any way to include line breaks in a text variable? 

I have a textbox displaying the current text variable, and I want to be able to change the text variable so the text in the textbox gets updated,almost every new text contain line breaks.

/David

9 Replies
Dennis Hall

Hi David:

You describing 2 different things. The text in the text box will be updated if the variable is working.

Forcing a line break in a text box is another thing.

The method I use to ensure text is wrapped (or a line break occurs) is to right-click the text box, select Format shape, select Text Box in the left menu, then select the radio button that forces the text to fit the text box.

Hope this helps.

Best Regards,

Dennis Hall

Dave L

Hi, thank you for quick responses.

I actually just want to be able to include line breaks in a text variable for later usage.

For example, I want to set a variable textboxText to:

"Hi,

What is your name?

Cheers!"

And then on another slide print the variable in a textbox. Right now I can't get the line break to show in the new textbox.

Dennis Hall

Hi David:

Understand. Unfortunately, you will not be able to split a variable across lines.

Looking at your example, I could see 3 variables, yet do not understand exactly why the first and third would not be constants.

Are you trying to accomplish something related to translations?

Can you elaborate on what you are trying to accomplish?

Best Regards,

Dennis Hall

Dave L

Hi, 

ok.

I'm building a e-learning course that contains around 50 slides and on every slide there will be a textbox at the bottom with different text on every slide describing the content of the slide (with line breaks). Instead of having 50 different text boxes, I would like to have only one textbox in a masterpage layout that shows a text variable that I can change on the different slides. This way it would be very easy to change text color, textbox size etc for all slides easily.

Dennis Hall

Hi David:

Thanks for clarifying.

The master slide will take care of you for styling, but line breaks won't happen. I know of no elearning IDE that will automatically allow for line breaks.

I have not attempted this myself, however, you may want to look into a JavaScript solution such as: string.match(/.{1,10}/g).join("
"
);

Best Regards,

Dennis Hall

This discussion is closed. You can start a new discussion or contact Articulate Support.