Problem maintaining position of text in a field
Posted: Wed May 17, 2017 3:24 am
I am working on a project in which I want to select HTML tags from a list and insert them into text in a multi-line field. Once all of the desired tags are inserted, the text is then displayed in a browser window.
I have the code completed to achieve this routine. I position the cursor in the text field at the point I want to insert the tag, and click the list item of the desired tag. I then build a temp string consisting of the LEFT$ of the field text up to the insert point, the tag extracted from the list string array, and the RIGHT$ text of the field from the insert point to the end.
The final step is to insert this new string back into the field. When I do that, the text scrolls to the very bottom, and the edited area can not be seen. I have to manually scroll the field text up to see the edit.
Is there any way to position a specific portion of text in the visible area of a field? I thought I could use the command FIELD "edit" SELECT n, n being the location where the tag was inserted. This command does locate the cursor at that point, but it isn't visible until I scroll the field text up by hand. Anyone have a method for either preventing text from scrolling to the bottom when i use the command FIELD "edit" TEXT tagarray$(23), or instantly scrolling the view back up to the cursor location?
I have the code completed to achieve this routine. I position the cursor in the text field at the point I want to insert the tag, and click the list item of the desired tag. I then build a temp string consisting of the LEFT$ of the field text up to the insert point, the tag extracted from the list string array, and the RIGHT$ text of the field from the insert point to the end.
The final step is to insert this new string back into the field. When I do that, the text scrolls to the very bottom, and the edited area can not be seen. I have to manually scroll the field text up to see the edit.
Is there any way to position a specific portion of text in the visible area of a field? I thought I could use the command FIELD "edit" SELECT n, n being the location where the tag was inserted. This command does locate the cursor at that point, but it isn't visible until I scroll the field text up by hand. Anyone have a method for either preventing text from scrolling to the bottom when i use the command FIELD "edit" TEXT tagarray$(23), or instantly scrolling the view back up to the cursor location?