How to find when the enter key pressed in a memo 
Author Message
 How to find when the enter key pressed in a memo

How do I find when the enter key was pressed in a memo?
I looked at the string of each memo line and I see '..' for each enter
key press. BUT, instring gives a false when on the string. When in the
debuger the string shows '..'



Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Search for CR/LF:  '<13,10>'.

 Ndx = Instring('<13,10>', String, 1, 1)

Sometimes you need to search for them individually '<13>'  and  '<10>'

hth,

Quote:

>How do I find when the enter key was pressed in a memo?
>I looked at the string of each memo line and I see '..' for each enter
>key press. BUT, instring gives a false when on the string. When in the
>debuger the string shows '..'

Jeff Slarve  [Team Topspeed(CW)(Compuserve)]
(CW2003, DET 2.2, RPM, PwrBrw, CPCS, PDLookup, Ultra Tree, G-Reg, etc.) Since 1991
J & S Software Co.  http://www.jssoftware.com
(CIS: 73501,1323) Using Agent 1.5 and loving it!


Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Hi Jeff,



Quote:
>Search for CR/LF:  '<13,10>'.

> Ndx = Instring('<13,10>', String, 1, 1)

>Sometimes you need to search for them individually '<13>'  and  '<10>'

I just remembered that I had a strange problem when playing with a
memo once;)  What I did was to prefix the string in the memo with some
text and a cr/lf:

MYF:Memo = 'My text line' & '<13,10>' & Clip(MYF:Memo)
Display(?MYF:Memo)

This worked perfectly, but the problem was that when I clicked on the
text control, it would replace the <13,10> with two blocks.  In
another system I use this to build memos from pre formatted ascii
files and after reading each line from the ascii file I just do:

MYF:Memo = Clip(MYF:Memo) & ASC:Line & '<13,10>'

This works perfectly and no "odd" characters.  In the first case I
tried to put just 13 and just 10 and 10,13 and it never turned out
correctly.  I don't remember if it was in CW2.0 or C4.

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com
UIN nr.: 2428601



Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Hi Jimmy,


Quote:

>How do I find when the enter key was pressed in a memo?
>I looked at the string of each memo line and I see '..' for each enter
>key press. BUT, instring gives a false when on the string. When in the
>debuger the string shows '..'

Instring('<13,10>',MYF:Memo,1,1)

should return the position for a line break.  If you want to trap the
enter key in the memo, I think you should be able to alert the enter
key on the text control and then code what you need in the AlertKey
event on the text control.

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com
UIN nr.: 2428601



Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Quote:

>Search for CR/LF:  '<13,10>'.

> Ndx = Instring('<13,10>', String, 1, 1)

>Sometimes you need to search for them individually '<13>'  and  '<10>'

I would search for the ascii character instead. Look at 'chr'.




Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Arnor,

    I believe the difference between showing the blocks for CRLF or not was
whether it was a TEXT control or not. If I remember, TEXT controls just
give a new line and STRING (or almost any other Windows control) give the
blocks.

    Regards,

    kurtt

Quote:

> Hi Jeff,



> >Search for CR/LF:  '<13,10>'.

> > Ndx = Instring('<13,10>', String, 1, 1)

> >Sometimes you need to search for them individually '<13>'  and  '<10>'

> I just remembered that I had a strange problem when playing with a
> memo once;)  What I did was to prefix the string in the memo with some
> text and a cr/lf:

> MYF:Memo = 'My text line' & '<13,10>' & Clip(MYF:Memo)
> Display(?MYF:Memo)

> This worked perfectly, but the problem was that when I clicked on the
> text control, it would replace the <13,10> with two blocks.  In
> another system I use this to build memos from pre formatted ascii
> files and after reading each line from the ascii file I just do:

> MYF:Memo = Clip(MYF:Memo) & ASC:Line & '<13,10>'

> This works perfectly and no "odd" characters.  In the first case I
> tried to put just 13 and just 10 and 10,13 and it never turned out
> correctly.  I don't remember if it was in CW2.0 or C4.



Mon, 13 Nov 2000 03:00:00 GMT  
 How to find when the enter key pressed in a memo

Hi Kurt,

On Thu, 28 May 1998 19:55:57 -0500, Kurt Pawlikowski

Quote:

>    I believe the difference between showing the blocks for CRLF or not was
>whether it was a TEXT control or not. If I remember, TEXT controls just
>give a new line and STRING (or almost any other Windows control) give the
>blocks.

I'm talking about the text control.  If I had a button that inserted
some text at the top of the original text and the text I inserted had
cr/lf it would double next time the text control refreshed.  I'll see
if I can demo this over the weekend;)

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com
UIN nr.: 2428601



Tue, 14 Nov 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Memo field, using enter key and tab key.

2. How to find exactly which key is pressed?

3. How to capture key-presses (keyboard-presses)???

4. Problem:Want ENTER key in form to act as TAB key

5. change TAB key to ENTER key in Windows

6. Using ENTER-key as TAB-key

7. Pressing Enter in TextEditorSpec

8. Sending event when user presses ENTER

9. Keyboard frezes when pressing alt-enter

10. RE-How to get char without press enter ADA83

11. Form submission problem when pressing enter

12. Enter - Leave binding with button pressed

 

 
Powered by phpBB® Forum Software