Don't laugh, I'm waiting for the manual

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Don't laugh, I'm waiting for the manual

Post by dalkin » Thu May 08, 2008 8:33 am

Sorry for the simplicity of this but I've just spent 2 hours trying to sort it with no luck.

I want people to have the facility to insert their own items into a pre-populated list field. I've created 2 fields and 1 button. 'Stop' is where they can add a word, and 'List Field' is the already populated list. This is as far as I've got, attaching this code to the button:

on mouseUp
select the text of field "Stop"
put the selectedText into the field "List Field"
end mouseUp

it puts it into the field okay but deletes the existing contents.
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

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

Post by Klaus » Thu May 08, 2008 9:53 am

Hi Ian,

can't you just:
...
put fld "Stop" into fld "List field"
## or ... before/after/into line x of fld "Lsit field"
...

? :-)


Best

Klaus

dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Post by dalkin » Thu May 08, 2008 10:05 am

Klaus my friend,

My thanks to you are becoming a bit of a habit, eh?

Kind regards ...
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

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

Post by Klaus » Thu May 08, 2008 10:48 am

Hi Ian,

anyway, I never can get enough of that ;-)


Best

Klaus

dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Post by dalkin » Thu May 08, 2008 11:53 am

I'm sorry, I still can't get it to return field 1 to the top of the list without it overwriting and replacing the contents.

on mouseUp
put field "Stop" into field "List Field"
end mouseUp

certainly works but it doesn't move the existing content down 1 line to accommodate the new entry. I can't get my head round 'into' after' or before' - I can't see how they work.
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

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

Post by Klaus » Thu May 08, 2008 12:07 pm

Hi Ian,

just think of a text processor!
How do you add a new line BEFORE the existing content?
You start to write in the first line and then hit RETURN, right?
And that's exaxtly how Rev works :-)

So to put a line (field or variable) BEFORE an existing content you can:
put fld "New line" & CR BEFORE fld "Old content"

To add a line AFTER existing:
put CR & fld "New Line" AFTER fld "Old content"

etc...

The CR (new line!) is extremely important to REALLY get a new line!

Hope that helps.


Best

Klaus

Post Reply