Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How do I identify the row number of the active selection?


This topic is 5996 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I have been trying to find an answer to this question? Up to this point I am stumped.

I have a list of words in a global field. I want to get the line number of the location of word based upon the location of the cursor in the field. For example, if the list showed:

carrot

celery

broccoli

spinach

and the user had their cursor next to the word broccoli the computer would return 3 for line number 3.

I would appreciate any help I can get in this matter.

Thanks,

Toby

Posted

As a guess, I'd suggest using the cursor position function to work out where it is in the string; then truncate the string to the cursor position and work out how many carriage returns are in the truncated string, and with this information work out the line number.

Posted

That sounds good:

Let( [ 

   cursor = Get(ActiveSelectionStart) ; 

   text = Left( veggiesField ; cursor ) ; 

   lines = ValueCount ( text ) ] ;



  lines )

  • Newbies
Posted

:smirk: Thank you for the help. The calculations below worked great. I really appreciate the prompt replies. Have a great day. :smirk:

Let( [

cursor = Get(ActiveSelectionStart) ;

text = Left( veggiesField ; cursor ) ;

lines = ValueCount ( text ) ] ;

lines )

This topic is 5996 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.