Page 1 of 1

AkelPad.ReplaceSel parameter -2?

Posted: Thu Feb 01, 2018 2:59 am
by CBruce
I see script code in the forum with:

Code: Select all

AkelPad.ReplaceSel(pText, -2)
I just used that in a script, but the documentation only shows T/F as bSelect parameter.

Is there something special about the -2 value as the parameter? Or is it just acting as True?

Code: Select all

(Scripts_en.txt)

AkelPad.ReplaceSel
__________________
Replace selection.
  ReplaceSel(pText[, bSelect]);
Arguments
  pText
    Text to replace with.
  bSelect
    true   select inserted text.
    false  don't select inserted text (default).
Return Value
  Zero.
Example:
  AkelPad.ReplaceSel("MyText");

Re: AkelPad.ReplaceSel parameter -2?

Posted: Thu Feb 01, 2018 6:40 am
by opk44
CBruce wrote:but the documentation only shows T/F as bSelect parameter.
Still using the outdated version?
See docs in AkelPad 4.9.1-4.9.9, Scripts-plugin v15.9-18.6 (2014.12.16->):

Code: Select all

AkelPad.ReplaceSel
__________________

Replace selection.

  ReplaceSel(pText[, nSelect]);

Arguments
  pText
    Text to replace with.
  nSelect
     0  //RST_NONE                 don't select inserted text (default).
    -1  //RST_SELECT               select inserted text.
    -2  //RST_SELECTRESTORESCROLL  select inserted text and restore scroll position.

Return Value
  Zero.

Example:
  AkelPad.ReplaceSel("MyText");

Posted: Thu Feb 01, 2018 8:49 pm
by CBruce
Thanks, opk44.

That was it.
I also had an old Coder_en.txt. Both updated now.