tabKey in table fld
Jan Schenkel
janschenkel at yahoo.com
Mon Oct 25 16:07:05 EDT 2004
--- Hershel Fisch <hershrev at realtorsgroup.us> wrote:
>
> On Monday, October 25, 2004, at 11:16 AM, Jan
> Schenkel wrote:
>
> > --- Hershel Fisch <hershrev at realtorsgroup.us>
> wrote:
> >> Hi all
> >> They were many discussion around this topic, but
> >> this particular
> >> question wasn't answered yet.
> >> How can I determine thru tabbing in which cell
> the
> >> cursor is located
> >> "only with the tab key" , which function should I
> >> use and how to use it
> >> ?
> >> Thanks a mill. Hershel Fisch
> >>
> >
> > Hi Hershel,
> >
> > If you mean a field where 'Table behavior' is
> turned
> > on, you can get the cREVTable["currentxcell"] and
> the
> > cREVTable["currentycell"] properties of the field.
> >
> > If you mean a field where you've turned on the
> > 'Vertical grid' without turning on 'Table
> behavior'
> > then you'll have to count the tabs and returns I'm
> > afraid -- unless someone has a better idea ?
>
> I mean rather this one. How would I do that ?
> It just occurred to me to use "selectedLoc" and use
> item 1 or 2 to
> convert it to lines and items and the use "select"
> item x of line x ,
> but its a bit complicated.
You are close : have a look at the 'selectedChunk'
property. This will be of the form :
char 7 to 19 of field "Foobar"
So your field would have a script like this :
--
on AnswerTheCurrentCell
put the selectedChunk into tChunk
put word 2 of tChunk into tStartPosition
put char 1 to tStartPosition of me into tTextBefore
## now count the number of lines in tTextBefore
put the number of lines in tTextBefore \
into tRow
set the itemDelimiter to tab
put the number of items of line -1 of tTextBefore \
into tColumn
answer "row:" && tRow & return & \
"column:" && tColumn
end AnswerTheCurrentCell
--
Hope this helped,
Jan Schenkel.
=====
Join us at the European Revolution Conference
November 14-16, MALTA. ~ http://TechieTours.com/Rev/
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the use-livecode
mailing list