Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After setsel - how to leave the new text selected
#1
Hi all,

After I invoke on text (in an editable window/control) the getsel function, (e,.g.,
Code:
Copy      Help
str s.getsel
) and then setsel,

how can I leave the new text selected? I.e., in place of the original selected text that I read?

E.g., I found on this forum the following macro to S-w-a-p---C-a-s-e of text.
So I select text in a textbox, run the macro, and it does its thing and replaces the text, but it is o longer selected.
Is there some way I can keep the selection?


Code:
Copy      Help
str s.getsel
if(!s.len) ret
int i is
for i 0 s.len
,if(isalpha(s[i]))
,,is=1
,,if(isupper(s[i])) s[i]=tolower(s[i])
,,else s[i]=toupper(s[i])
if(is) s.setsel


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)