June 23, 200817 yr Newbies 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
June 23, 200817 yr 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.
June 24, 200817 yr That sounds good: Let( [ cursor = Get(ActiveSelectionStart) ; text = Left( veggiesField ; cursor ) ; lines = ValueCount ( text ) ] ; lines )
June 24, 200817 yr Author Newbies :smirk: Thank you for the help. The calculations below worked great. I really appreciate the prompt replies. Have a great day. Let( [ cursor = Get(ActiveSelectionStart) ; text = Left( veggiesField ; cursor ) ; lines = ValueCount ( text ) ] ; lines )
Create an account or sign in to comment