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?
Problem maintaining position of text in a field
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Problem maintaining position of text in a field
The only thing that gets me down is gravity...
- GeorgeMcGinn
- Posts: 435
- Joined: Sat Sep 10, 2016 6:37 am
- My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10 - Location: Venice, FL
- Flag:
- Contact:
Re: Problem maintaining position of text in a field
Without seeing the code and the HTML that you are trying to create, I am having a hard time following what it is you're doing and what or why it isn't working.
From what I understand, it sounds like in HTML you are either or you may need to create a field called <textarea> which allows multi-line text. You can define the number of columns and the number of rows.
Here's a link to some info about <textarea>: https://developer.mozilla.org/en-US/doc ... t/textarea
If you want to email me the code (in case it is not ready to share with everyone), I can have a better understanding of how you are creating your HTML Page using FIELDS.
George.
From what I understand, it sounds like in HTML you are either or you may need to create a field called <textarea> which allows multi-line text. You can define the number of columns and the number of rows.
Here's a link to some info about <textarea>: https://developer.mozilla.org/en-US/doc ... t/textarea
If you want to email me the code (in case it is not ready to share with everyone), I can have a better understanding of how you are creating your HTML Page using FIELDS.
George.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Problem maintaining position of text in a field
Thanks, George. I am familiar with textarea in HTML, but that won't solve my problem. It Is not a browser issue, since it occurs only in a multi-line field. From what I see in the documentation, if my text is too large to fit in an ML field, there is no way to control which portion of the text will be visible.
The only thing that gets me down is gravity...
- GeorgeMcGinn
- Posts: 435
- Joined: Sat Sep 10, 2016 6:37 am
- My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10 - Location: Venice, FL
- Flag:
- Contact:
Re: Problem maintaining position of text in a field
Actually, I have a workaround to that as I needed to do something similar.
With the app I put an editor in, I do the following which might help you out.
I put all the text in an array, and then when I display it in a ML TEXT I use pointers to determine which line to start.
Say my ML TEXT box only displays 20 lines, and I want it to display starting at 21, I start set my array index to 21 as the first line written to the TEXT FIELD.
I also use NEXT and PREV buttons and when I click the next button, it adds 20 to the current array pointer and then I recreate the ML TEXT FIELD by concatenation my string with the next 20 occurrences of the array.
George.
With the app I put an editor in, I do the following which might help you out.
I put all the text in an array, and then when I display it in a ML TEXT I use pointers to determine which line to start.
Say my ML TEXT box only displays 20 lines, and I want it to display starting at 21, I start set my array index to 21 as the first line written to the TEXT FIELD.
I also use NEXT and PREV buttons and when I click the next button, it adds 20 to the current array pointer and then I recreate the ML TEXT FIELD by concatenation my string with the next 20 occurrences of the array.
George.
rbytes wrote: ↑Mon May 22, 2017 2:09 pmThanks, George. I am familiar with textarea in HTML, but that won't solve my problem. It Is not a browser issue, since it occurs only in a multi-line field. From what I see in the documentation, if my text is too large to fit in an ML field, there is no way to control which portion of the text will be visible.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Problem maintaining position of text in a field
That's a good idea, and I will use it in my next Prompter update.
Thanks, George.
Thanks, George.
The only thing that gets me down is gravity...