rhennink Posted March 28, 2016 Posted March 28, 2016 HI, We would like to insert a string (from a variable) at the current cursor-position of the UniHTMLMemo. How do we do that?? Richard Quote
Sherzod Posted March 28, 2016 Posted March 28, 2016 Hi, Try: procedure TMainForm.UniButton1Click(Sender: TObject); var s: string; begin s := 'something'; UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor("'+ s +'")'); // or - UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor("'+ s +'" + " ")'); end; Best regards. 1 Quote
rgreat Posted December 12, 2018 Posted December 12, 2018 UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor("'+ s +'")'); or UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor('+ StrToJS(s) +')'); ? 1 Quote
Sherzod Posted December 12, 2018 Posted December 12, 2018 Yes, Use this: UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor('+ StrToJS(s) +')'); Quote
M.Ammar Posted September 29, 2019 Posted September 29, 2019 On 12/12/2018 at 10:38 PM, Sherzod said: Yes, Use this: UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor('+ StrToJS(s) +')'); Hi I know it is an old post but I have 2 questions 1- how to move the Cursor to the end of the document as I want to add to the end of the old text Or another way to add to the end; 2- StrToJS is giving error so iam using the other way ("'+ s +'") what do I add in the uses list to make it work? regards and thanks for help Quote
Sherzod Posted September 29, 2019 Posted September 29, 2019 Hi, 2 hours ago, M.Ammar said: 1- how to move the Cursor to the end of the document as I want to add to the end of the old text Or another way to add to the end; UniHTMLMemo1.Lines.Add('add to the end...'); ? 2 hours ago, M.Ammar said: 2- StrToJS is giving error so iam using the other way ("'+ s +'") what do I add in the uses list to make it work? Can you make a simple testcase or provide the code? 1 Quote
Ronbral Posted September 29, 2019 Posted September 29, 2019 Add to your Uses list: Uses ExtPascalUtils; 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.