Page 1 of 1

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

Posted: Thu May 08, 2008 8:33 am
by dalkin
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.

Posted: Thu May 08, 2008 9:53 am
by Klaus
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

Posted: Thu May 08, 2008 10:05 am
by dalkin
Klaus my friend,

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

Kind regards ...

Posted: Thu May 08, 2008 10:48 am
by Klaus
Hi Ian,

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


Best

Klaus

Posted: Thu May 08, 2008 11:53 am
by dalkin
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.

Posted: Thu May 08, 2008 12:07 pm
by Klaus
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