Line breaks and multiline

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Line breaks and multiline

Post by teacherguy » Sat Oct 24, 2015 8:00 pm

I've stumbled on an interesting issue. I have a multiline control that, upon the end of editing, deposits the text into a card field. Well, if the user types manually and uses the return key to make a column of data, everything works fine. But if the user pastes a column of text, the line breaks are not recognized and one long string is deposited into the field after editing is done.

Any ideas (a) why this is the case and (b) how to counteract?

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

Re: Line breaks and multiline

Post by FourthWorld » Sat Oct 24, 2015 8:21 pm

What platform? And from what program was the data copied?

You might find getting the clipboardData["text"] and then checking charToNum on the line endings helpful.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Line breaks and multiline

Post by teacherguy » Sat Oct 24, 2015 9:26 pm

Thanks Richard. I tried copying a column of text from iMessage and pasting into my app...in the simulator. Visually it pastes in just fine but after editing closes it deposits into the field as a string.

I will take a look at the ideas you mention, thanks.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Line breaks and multiline

Post by teacherguy » Sat Oct 24, 2015 9:58 pm

I loaded the app onto my iPad and it works just fine... I guess it's a simulator glitch.

Post Reply