Get active line in field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Get active line in field

Post by doobox »

Hi there,

I cant seem to find the way to get the active line (currently flashing text cursor), in a text field..?

I am needing something resembling :

on textChange
put the activeLine of field "textField" into tCurrentWorkingLine
end textChange
Kind Regards
Gary

https://www.doobox.co.uk
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Get active line in field

Post by doobox »

Ahhh.. got it..

Code: Select all

on mouseUp
   put "test" after the selection
   put  the lineIndex of the selection into tCapturedLine
   put line tCapturedLine of field "test" into field "capturedLine"
end mouseUp
Kind Regards
Gary

https://www.doobox.co.uk
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get active line in field

Post by Klaus »

Hi Gary,

... the lineindex of the selection...???? 8)
Where did you find this?


Best

Klaus
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Get active line in field

Post by Dixie »

Klaus...

He got it from the dictionary...:-)

be well

Dixie
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get active line in field

Post by Klaus »

Oh, this is LC 5.5, right?
OK, in that case I will not find it in MY dictionary yet :D
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Get active line in field

Post by doobox »

I did not find it in the dictionary.. Just guess work. Does the job though :-)
Kind Regards
Gary

https://www.doobox.co.uk
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get active line in field

Post by Klaus »

Hi Gary,

well, it IS not in the dictionary, that's what's puzzling me :-)
So are you using LC 5.5?


Best

Klaus
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Get active line in field

Post by doobox »

Here is the concise way i ended up using it :

Code: Select all

on textChanged
   put  the lineIndex of the selection into tCapturedLine
   put line tCapturedLine of me into field "currentLine"
end textChanged
Year 5.5 but i don't see it in dictionary here either.
Kind Regards
Gary

https://www.doobox.co.uk
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Get active line in field

Post by doobox »

I tell a lie... lineIndex is there :

Examples:
-- Example: 2 lines of text in a field
-- Hello World
-- Goodbye World

the lineIndex of char 7 of field 1 -- 1
-- char 7 is on line 1


the lineIndex of word 4 of field 1 -- 2
-- word 4 is on line 2
Kind Regards
Gary

https://www.doobox.co.uk
sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Get active line in field

Post by sturgis »

Ok wow. I obviously need to go through the new dictionary!
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get active line in field

Post by Klaus »

Looks like I need to get some bucks and buy the update :D
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Get active line in field

Post by jacque »

The first thing I always do after a release is read the release notes, which are in the Help menu. At the bottom of the notes is a summary of all the new features. Then I know what to look up in both the release notes and the dictionary.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply