Getting current line number of a table field.
Tim Selander
selander at tkf.att.ne.jp
Wed Feb 14 17:53:50 EST 2018
Hi Mike,
Thanks! I put the script in the table field itself with no luck.
But when I moved it to the card script, it works! Great! I never
would have come up with that in a million years.
This list is fantastic.
Oh, and I just re-named the table field to "Opera" ;-)
Tim Selander
Tokyo, Japan
On 2018.02.15 1:04, Mike Bonner via use-livecode wrote:
> Try this...
>
> on rawkeyup pkey
> send "getline" to me in 10 millisec
> pass rawkeyup
> end rawkeyup
>
> command getline
> put the short name of the focusedobject
> end getline
>
> This gives you the name of the editing field that appears for each cell in
> the form of:
>
> revCell-2,2
>
> Parse that and voila, you have your info.
>
> On Wed, Feb 14, 2018 at 8:35 AM, dunbarx via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> You know, this proved more of a problem than I thought.
>>
>> Richmond, the issue is with tab and return keyPresses, not mouse clicks.
>> Anyway, given a table field 1 and another field 2, this works if you tab or
>> return in the table field:
>>
>> on rawKeyUp tKey
>> put the selectedLoc && the selectedChunk into fld 2
>> pass rawKeyUp
>> end rawKeyUp
>>
>> And this works fine in a button:
>>
>> on mouseUp
>> set the itemDel to tab
>> select item 2 of line 2 of fld 1
>> answer the selectedLine of fld 1
>> end mouseUp
>>
>> But this does not in the table field:
>> on rawKeyDown tKey
>> put "" into fld 2
>> put the selectedLine into fld 2
>> pass rawKeyDown
>> end rawKeyDown
>>
>> I always get "line 1 of field 3" (!!!!)
>>
>> Kluge city to get the line from the selectedLoc, but that would indeed
>> work.
>>
>> Is it that in a table field, if only one "cell" is selected, the
>> selectedLine just does not compute?
>>
>> Craig Newman
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://runtime-revolution.278305.n4.nabble.com/
>> Revolution-User-f278306.html
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list