Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding data to memo field
Message
 
To
17/11/2015 08:15:43
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01627541
Message ID:
01627553
Views:
43
>>>>>>In my application when I click on a command button it opens up a memo field for editing but the cursor is always pointing to the top of the memo field
>>>>>>
>>>>>>How do I get the cursor to start at the end of the memo field?
>>>>>
>>>>>Hi colin
>>>>>
>>>>>you want to use selstart and set it to the length of the text
>>>>
>>>>The data is displayed in text32 - I want to add 10 characters and continue typing-
>>>>The data is in the Notes field
>>>>
>>>>My code is
>>>>
>>>>select globalnew
>>>>STORE LEN(TRIM(notes)) TO ww
>>>>ww=ww+10
>>>>
>>>>
>>>>thisForm.text32.SelStart=ww
>>>>thisform.refresh
>>>>
>>>>
>>>>What have I done wrong?
>>>
>>>I'm just guessing that the cursor position is at the end of the text, not the end of the text plus 10. Is that what the problem is?
>>>
>>>You will need to add space(10) to the end of your string in order for ww to be correct.
>>>
>>>something like this:
>>>
>>>
>>>replace Notes with Notes + SPACE(10)
>>>STORE LEN(TRIM(notes)) TO ww
>>>thisForm.text32.SelStart=ww
>>
>>
>>No The next time I open the notes field I want the cursor to start at the previous data + 10 but all it does is to strat at the beginning of the notes field
>
>Here's some example code:
>
>
CREATE CURSOR test;
>(notes m(4))
>INSERT INTO test values( "This is some text")
>
>LOCAL oForm as Form 
>oform = CREATEOBJECT("Form")
>oForm.AddObject("oEdit", "myEditbox")
>
>WITH oForm.oEdit
>.Top = 4
>.Left = 4
>
>.height = oForm.Height - 8
>.Width = oForm.Width - 8
>
>.controlsource = "test.notes"
>.setfocus()
>
>.Visible = .T.
>
>ENDWITH 
>oForm.Show(1)
>
>DEFINE CLASS myEditBox as EditBox
>
>PROCEDURE gotfocus
>
>this.Value = this.Value + SPACE(10)
>this.SelStart = LEN(this.Value) + 10
Thanks a lot Frank
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Reply
Map
View

Click here to load this message in the networking platform