Another Dumb Field Problem!
David Burgun
dburgun at dsl.pipex.com
Wed Aug 24 14:24:20 EDT 2005
>My pleasure,
>
>Use this wording:
>
> Select before field 1
Thanks a lot for this,
>That will place the cursor at the top of the field. The difference
>between our two scripts is that your method is using the field number,
>and my method is using the field name. For my method to work, the fields
>have to actually be named with the same first word, such as "myField 1"
>, "myField 2" , etc...
>
>Using field number is ok, as long as their layer properties correspond
>to their vertical location in the group. If you go into the group after
>you have created it, and add a new field that is located between two
>other fields, then be sure to reset their layer properties so that they
>correspond to their vertical location in the group. Otherwise, you will
>wind up jumping to the wrong field.
>
>By the way, my original script can be modified so that you can have
>other fields in the same group that are not part of the series. I tested
>this script, and it works perfectly. I will send the test stack to you
>offlist, so you can see how it is implemented:
>
>On tabkey
> Put the short name of the target into tField
> Put word 1 of tField into tFieldName
> Put word 2 of tField into tFieldNumber
> Put 0 into tFieldCount
> Repeat with X = 1 to the number of fields in me
> If word 1 of the short name of field X of me = tFieldName then add 1
>to tFieldCount
> End repeat
>
> If the shiftkey is down then
> If tFieldNumber > 1 then
> Subtract 1 from tFieldNumber
> Else
> Put tFieldCount into tFieldNumber
> End if
> Else if the commandkey is down then
> If the selectedfield <> empty then
> Put Tab into the selection
> Exit tabkey
> End if
> Else
> If tFieldNumber < tFieldCount then
> Add 1 to tFieldNumber
> Else
> Put 1 into tFieldNumber
> End if
> End if
> Put tFieldName && tFieldNumber into tNewField
> Select before field tNewField of me
>End tabkey
This is a much better way of doing it. I was trying to get something
like this but couldn't quite get there! Thanks Again!
All the Best
Dave
More information about the use-livecode
mailing list