Continues flds

Kay C Lan lan.kc.macmail at gmail.com
Wed May 7 23:58:26 EDT 2008


OK this is what I did as a VERY BASIC test to create a field that once you
'fill a field up' it will automatically take you to the 'Next Card' which
has the same field and allows you to just keep typing.

New stack.
New plain field 'Field1'
Make it a group and give it backgroundBehavior
Make a New Card and check that 'Field1' is automatically copied across.
In the group script put this 11 line script.

1  ON rawKeyDown pKeyCode
2     IF ((the formattedheight of field "Field1") > (the height of field
"Field1")) THEN
3         go to card (the number of this card + 1)
4         put char -1 field "Field1"  of card (the number of this card - 1)
into field "Field1"
5         delete char -1 of field "Field1" of card (the number of this card
- 1)
6         select after field "Field1"
7         pass rawKeyDown pKeyCode
8     ELSE
9         pass rawKeyDown pKeyCode
10    END IF
11 END rawKeyDown


Notes:
1) Unlike the documentation that say its important to 'pass rawKeyDown' and
then give an example without the the actual key code to pass, it's
imperative to include this vital parameter.
2) You need to play with formattedHeight and height because in this basic
version the text will skip to the next field when their is still quite a
margin left - I assume it has something to do with margins so maybe
formattedHeight > (height + margin) or margin/2?
3) You'll need to be check that a Next Card exists or create one if doesn't.
4) Haven't though too much about Pasting text in - I imagine you'd need some
kind of 'Repeat for each' loop to simulate typing the text in.

It's a very basic start, but it's possible.



More information about the use-livecode mailing list