Live code text feild and datagrid problem

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
daybreak
Posts: 4
Joined: Wed Nov 04, 2015 5:29 am

Live code text feild and datagrid problem

Post by daybreak » Wed Nov 04, 2015 6:09 am

Basically I want the user to type a name of item in text field box. when they click the confirm button it should show up in the data grid. Now the problem i'm having is how to get the text to move to line 2 when the user enters another name and click the confirm once and not overwriting the previous on the same line?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Live code text feild and datagrid problem

Post by dunbarx » Wed Nov 04, 2015 3:00 pm

Hi.

Try this experiment. Make a button and two fields on a card. In the button script:

Code: Select all

on mouseUp
   put the last line of fld 1 into fld 2
   put return after fld 1
   select after fld 1
end mouseUp
Now if you type into fld 1, and then click the button, the text just typed will appear in fld 2. The selection will move to the next line in fld 1, ready for new data.

This is a cute little lesson in using LC to fool around with text. But it seems to me to be fragile, in that the user can upset the formatting of fld 1 by hand. So first off, does this actually do what you asked? If so, is it robust enough? Do you think you want a bit more control over what the user does, so that he cannot, say, delete data or modify the format in fld 1? All these are possible. It also may be useful to re-think your input method. Write back with thoughts and complaints.

Craig Newman

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Live code text feild and datagrid problem

Post by Klaus » Wed Nov 04, 2015 3:03 pm

Hi daybreak,

1. hello and welcome to the forum! :D
2. What Craig said!


Best

Klaus

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Live code text feild and datagrid problem

Post by MaxV » Wed Nov 04, 2015 6:25 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

daybreak
Posts: 4
Joined: Wed Nov 04, 2015 5:29 am

Re: Live code text feild and datagrid problem

Post by daybreak » Wed Nov 04, 2015 11:41 pm

Hi guy and thank you all for the reply. Just got home I will test and see what works :)

Post Reply