SOLVED - Go to the next line of a text field?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CoreySchroeder
Posts: 26
Joined: Mon Sep 14, 2015 4:31 am

SOLVED - Go to the next line of a text field?

Post by CoreySchroeder » Sat Oct 10, 2015 11:14 pm

I have some text that I would like to display in a multiline field, however I cannot get it to work properly

Code: Select all


on mouseUp
put varName1 & " is very fast!" into field "fldOutput"
put varName2 & " is not nearly as fast as " & varName1 & "!" into field "fldOutput"
put varName3 & " is the slowest of all!!!" into field "fldOutput"
end mouseUp

I'd like the output to read:

John is very fast!
Bob is not nearly as fast as John!
Steve is the slowest of all!!!

However my field only displays one line of text - the last line entered.
I assume the program is actually showing all three lines, but the first two are being displayed so quickly I don't notice, then the program stops when displaying the last line.

So, how can I have the program display all of the lines mentioned above?
How can I move to the next line of the field in livecode?

CoreySchroeder
Posts: 26
Joined: Mon Sep 14, 2015 4:31 am

Re: SOLVED - Go to the next line of a text field?

Post by CoreySchroeder » Sat Oct 10, 2015 11:18 pm

Just fooling around with this, I realized that I could use a code similar to:

Code: Select all

put "blah" into line 1 of field "fldOutput"
put "blahblah" into line 2 of field "fldOutput"
I didn't read any documentation, just tried what felt natural.
Tip of the hat to the livecode "english like" syntax - always surprises me!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: SOLVED - Go to the next line of a text field?

Post by FourthWorld » Sat Oct 10, 2015 11:21 pm

CoreySchroeder wrote:I didn't read any documentation, just tried what felt natural.
That's the goal. Programming in any language can get complicated at times, and LiveCode is no exception. But with the design of the language, most of the time you've already accomplished enough to be more than motivated to figure out anything that might be difficult.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: SOLVED - Go to the next line of a text field?

Post by Simon » Sat Oct 10, 2015 11:53 pm

Hi Corey,
This code;

Code: Select all

put "blah" into line 1 of field "fldOutput"
put "blahblah" into line 2 of field "fldOutput"
Can also be written as

Code: Select all

put "blah"  & cr into field "fldOutput"
put "blahblah" after field "fldOutput"
cr is return and "after" is good to know because there is also a "before" :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply