Where am I ? FPD/Memo field

Where am I ? FPD/Memo field

Post by Jenny Jone » Fri, 08 Dec 1995 04:00:00



Is there any way to know what line number a chunk of
highlighted text or the cursor is on within a scrolling memo
(edit) field?

I've thought of using AT(_cliptext,memo), however, if there is
more than one occurance of the data, this won't work.  

I'm able to do this quite nicely in MAC and WINDOWS, but I've
had no luck yet in DOS.

TIA,

Sue Jones
HWI

 
 
 

Where am I ? FPD/Memo field

Post by Steven H. Singerma » Fri, 15 Dec 1995 04:00:00



>  Is there any way to know what line number a chunk of
>  highlighted text or the cursor is on within a scrolling memo
>  (edit) field?
>  I've thought of using AT(_cliptext,memo), however, if there is
>  more than one occurance of the data, this won't work.  

>  I'm able to do this quite nicely in MAC and WINDOWS, but I've
>  had no luck yet in DOS.

 What method are you using for MAC and WINDOWS  ?

 Does the  _MLINE system memory variable do anything for you ?
 It usually contains the offset  in the memo field  but  is usually used with the MLINE() function to directly  
 move the pointer.

 I have never needed to know the current position of my user in a memo field  and  so have never
 tried _MLINE in that way.

 Hope this helps at all.

*--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--*
  Steven H. Singerman
  President, Creative Logic


  Web-site: http://www.clogic.ca
*--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--*

 
 
 

Where am I ? FPD/Memo field

Post by Brian Copela » Sun, 17 Dec 1995 04:00:00


Quote:>>  Is there any way to know what line number a chunk of
>>  highlighted text or the cursor is on within a scrolling memo
>>  (edit) field?
>>  I've thought of using AT(_cliptext,memo), however, if there is
>>  more than one occurance of the data, this won't work.  
>>  I'm able to do this quite nicely in MAC and WINDOWS, but I've
>>  had no luck yet in DOS.

If you highlight a section of memo field and copy it to the clipboard
the Atline(_cliptext,<memo field name> will return the line number of
the first occurrence of the highlighted text.

The snippet below is a short demo - just replaces notes with the name of
your memo field.

SET SYSMENU AUTO
CLEAR

READ

PROCEDURE myline
mmess= 'Line no = '+STR(ATLINE(_CLIPTEXT,notes))
WAIT WINDOW mmess
RETURN

Remember the line number in a memo field is based on the width of the
memo field as determined by SET MEMO WIDTH TO xx.  The default is 50.

If you want the line number in the edit region make sure the width of
the edit area matches the memo width setting.

I hope this helps