Hi,
If you place an initial value, say 3 spaces or the word "Content: " in a
memo field mmoMemoField:Value := " ", the initial position when you
start typing is still the beginning of the field.
Is there a way to start typing, on whatever the current line is, in a
position at the end of the current content of the line, in an Edit or
Memo field?
So if the first line in the memo field has 3 spaces, can the cursor be
set at position 4?
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Is there a way to start an Edit/Memo field at a certain position?
Is there a way to start an Edit/Memo field at a certain position?
Further clarification:
The lWantReturn attribute is set to false, so that the carriage return
can be trapped.
When the carriage return is pressed, a CRLF is added to the current
TMemo.Value field, along with an initial value for the next line
e.g.
sInitialLineString := "CONTENTS: "
::memoField:Value := ::mmoField:Value + CRLF + sInitialLineString
, but the cursor afterwards always ends up in the first column, first line.
The Help file mentions an nLine property, which unfortunately generates
a No exported variable message when used:
e.g.
::mmoField:nLine := 7
If the property function is used directly, e.g.
::mmoField:SetLineNumber( 2 ),
same thing for the nColumn property, which is in the Memo.prg source,
but not mentioned in the Help file.
I'm assuming that GetColumnNumber() and GetLineNumber() can't be used
because they are set to RESERVED. But nLine and nColumn should be
available.
The lWantReturn attribute is set to false, so that the carriage return
can be trapped.
When the carriage return is pressed, a CRLF is added to the current
TMemo.Value field, along with an initial value for the next line
e.g.
sInitialLineString := "CONTENTS: "
::memoField:Value := ::mmoField:Value + CRLF + sInitialLineString
, but the cursor afterwards always ends up in the first column, first line.
The Help file mentions an nLine property, which unfortunately generates
a No exported variable message when used:
e.g.
::mmoField:nLine := 7
If the property function is used directly, e.g.
::mmoField:SetLineNumber( 2 ),
same thing for the nColumn property, which is in the Memo.prg source,
but not mentioned in the Help file.
I'm assuming that GetColumnNumber() and GetLineNumber() can't be used
because they are set to RESERVED. But nLine and nColumn should be
available.
- ignacio
- Site Admin
- Mensajes: 9440
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Is there a way to start an Edit/Memo field at a certain position?
Childers escribió el vie, 26 julio 2013 01:09Hi,
If you place an initial value, say 3 spaces or the word "Content: " in a
memo field mmoMemoField:Value := " ", the initial position when you
start typing is still the beginning of the field.
Is there a way to start typing, on whatever the current line is, in a
position at the end of the current content of the line, in an Edit or
Memo field?
So if the first line in the memo field has 3 spaces, can the cursor be
set at position 4?
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected content
- To select any content use method SetSel()
For example:
WITH OBJECT oMemo
:SetSel( 3, 6 ) // From pos 3 to 6
:Replace( "New" )
END WITH
Regards,
Note: I highly appreciate if you could use the PRO groups.
If you place an initial value, say 3 spaces or the word "Content: " in a
memo field mmoMemoField:Value := " ", the initial position when you
start typing is still the beginning of the field.
Is there a way to start typing, on whatever the current line is, in a
position at the end of the current content of the line, in an Edit or
Memo field?
So if the first line in the memo field has 3 spaces, can the cursor be
set at position 4?
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected content
- To select any content use method SetSel()
For example:
WITH OBJECT oMemo
:SetSel( 3, 6 ) // From pos 3 to 6
:Replace( "New" )
END WITH
Regards,
Note: I highly appreciate if you could use the PRO groups.
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Is there a way to start an Edit/Memo field at a certain position?
>>
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected
content
<<
Yeah, I used Append previously, but didn't recall whether it would allow
the user to automatically start typing at a specific position. Will
try, thanks.
>>Note: I highly appreciate if you could use the PRO groups. <<
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
Hello,
- Use method Append( cText ) to add content add the end
- Use method Replace( cText ) to replace actual selected
content
<<
Yeah, I used Append previously, but didn't recall whether it would allow
the user to automatically start typing at a specific position. Will
try, thanks.
>>Note: I highly appreciate if you could use the PRO groups. <<
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
- ignacio
- Site Admin
- Mensajes: 9440
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Is there a way to start an Edit/Memo field at a certain position?
Childers escribió el vie, 26 julio 2013 12:25>>
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
Fixed. Now you should be able to post on PRO forums.
Regards,
Nope, that doesn't work. I've tried many times in the past, and it
continues to ask me for an id & password. When the password I have for
for forum is typed in, it says it's invalid.
Fixed. Now you should be able to post on PRO forums.
Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Is there a way to start an Edit/Memo field at a certain position?
Ok, will do so next time, thanks.