How to set cursor location
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to set cursor location
How to set the position of cursor in scrolling text field. I know the line number (say, line 15 of field 1), then how to set the position of cursor.
Re: How to set cursor location
Hi samjith,
check "select" in the dictionary, this will let you position the cursor in a field!
E.g. this will place the cursor at the beginning of line 15 of your field:
...
select before line 15 of fld "samjith's nice field"
...
Best
Klaus
check "select" in the dictionary, this will let you position the cursor in a field!
E.g. this will place the cursor at the beginning of line 15 of your field:
...
select before line 15 of fld "samjith's nice field"
...
Best
Klaus
Re: How to set cursor location
Hi Klaus,
Thanks for the quick reply. Code works fine.
I need certain replaces, if i select "replace_All" from my popup menu. The text in my screen moves automatically.
I want the changes, but i dont need to changes the text in the screen.
Thanks for the quick reply. Code works fine.
I need certain replaces, if i select "replace_All" from my popup menu. The text in my screen moves automatically.
I want the changes, but i dont need to changes the text in the screen.

Re: How to set cursor location
Hi samjith,
Best
Klaus
sorry, I'm afraid I don't understand what your problem is?samjith wrote: I need certain replaces, if i select "replace_All" from my popup menu. The text in my screen moves automatically.
I want the changes, but i dont need to changes the text in the screen.
Best
Klaus
Re: How to set cursor location
Code: Select all
case Revert_Once
put gmouse_line into RevertLine
if backgroundColor of button "UK" is red then
put the htmlText of RevertLine into myR
replace "<strike><font bgcolor=" & quote & "#FFFF00" & quote & ">" & gUS & "</font></strike><font bgcolor=" & quote & "#00FF00" & quote & ">" & gUK & "</font>" with "<font bgcolor=" & quote & "#00FF00" & quote & ">" & gUS & "</font>" in myR
set the htmlText of RevertLine to myR
put myR into gmouse_line
end if
if backgroundColor of button "US" is red then
put the htmlText of RevertLine into myR
replace "<strike><font bgcolor=" & quote & "#FFFF00" & quote & ">" & gUK & "</font></strike><font bgcolor=" & quote & "#00FF00" & quote & ">" & gUS & "</font>" with "<font bgcolor=" & quote & "#00FF00" & quote & ">" & gUK & "</font>" in myR
set the htmlText of RevertLine to myR
put myR into gmouse_line
end if
select before LineFinder
--unlock screen
--lock cursor
break
I have a txt file of more than 1000 line in my scrolling field.
If i select the above mentioned code from my popup menu. then replacement works fine. But the problem is that the text in scrolling field scrolls automatically
It is very difficult for me, to find the current line i worked before selecting the popup menu.
Re: How to set cursor location
Hi samjith,
aha, now I get it (more or less)
I would try to store the current scroll of the field BEFORE replacing etc, and set it back again afterwards.
...
put the scroll of fld "your field here" into tOldScroll
case ...
## Do your replace etc. here...
...
set the scroll of fld "your field here..." to tOldScroll
break
...
At least worth a try!
Best
Klaus
aha, now I get it (more or less)

I would try to store the current scroll of the field BEFORE replacing etc, and set it back again afterwards.
...
put the scroll of fld "your field here" into tOldScroll
case ...
## Do your replace etc. here...
...
set the scroll of fld "your field here..." to tOldScroll
break
...
At least worth a try!
Best
Klaus
Re: How to set cursor location
Hi Klaus,
Code works fine. Thanks for giving that wonderfull idea.
Cheers
Samjith
Code works fine. Thanks for giving that wonderfull idea.

Cheers
Samjith