Page 69 of 74
Posted: Tue Mar 01, 2016 5:22 pm
by Kley
VladSh
VladSh wrote:В GetArgValue не берётся значение по умолчанию при передаче пустой строки.
Code: Select all
"test" Call("Scripts::Main", 1, "test.js", `-arg=""`)
Это параметр - Пустая строка. А это по умолчанию
Code: Select all
"test" Call("Scripts::Main", 1, "test.js")
"test" Call("Scripts::Main", 1, "test.js", `-arg="default_text"`)
Надо же, как-то, передавать пустую строку

Posted: Tue Mar 01, 2016 6:32 pm
by VladSh
Kley wrote:Надо же, как-то, передавать пустую строку

Зачем?

Была когда-то такая необходимость? За всю историю не припомню.
"По умолчанию" - это 2-й параметр в GetArgValue. Если по умолчанию нужна пустая строка, то там и ставим "".
Добавлено: Хотя... логика понятна.
Posted: Tue Mar 08, 2016 2:37 pm
by Instructor
KDJ wrote:When I try to close any modified document (from the script), then displays message box "Document was modified. Do you want to save it?" and AkelPad hangs. On Win-XP sometimes, and on Win-7 always.
Fix searching took a few hours a week ago without luck, I remember about this report.
Posted: Sat Apr 23, 2016 12:40 am
by Instructor
KDJ wrote:Could you add optional parameter bAll for AkelPad.TextFind:
AkelPad.TextFind(hHandle, pFindIt, nFlags, bAll);
Return Value
- if bAll is true, the return value is count of occurences.
See Scripts 18.4. RRF_TEST requires
dev version of 4.9.8.
Posted: Sat Apr 23, 2016 12:40 am
by Instructor
Добавлено: флаг RRF_TEST в метод AkelPad.TextReplace - только тестирование (для количества замен).
Исправлено: WFF_APPENDFILE - BOM теперь добавляется только в начало файла.
Added: RRF_TEST flag in AkelPad.TextReplace method - test only (for count of changes).
Fixed: WFF_APPENDFILE - BOM now added only for file beginning.
Scripts plugin v18.4
Posted: Sat Apr 23, 2016 2:50 pm
by KDJ
Instructor
How to use RRF_TEST to get the count of all occurrences?
This code returns zero:
Code: Select all
WScript.Echo(AkelPad.TextReplace(0, "a", "b", 0x00200001 /*FRF_DOWN|FRF_BEGINNING*/, 0x2 /*RRF_TEST*/));
Posted: Sat Apr 23, 2016 3:08 pm
by Instructor
Posted: Sat Apr 23, 2016 3:43 pm
by KDJ
Instructor
But RRF_ALL|RRF_TEST replaces all occurences.
Posted: Sat Apr 23, 2016 9:51 pm
by Instructor
Posted: Sun Apr 24, 2016 1:28 pm
by KDJ
Instructor
Works fine, thank you very much.
Posted: Sun Apr 24, 2016 6:28 pm
by VladSh
Instructor
Если взялись за функционал поиска, то не могли бы Вы заодно добавить флаг в AkelPad.TextFind, чтобы, задать методу не выделять найденную строку, а просто возвращать номер позиции?
Posted: Thu Apr 28, 2016 5:29 am
by Instructor
KDJ
RRF_TEST replaced with FRF_TEST.
VladSh
См. флаг FRF_TEST. Требуется
разрабатываемая версия.
Posted: Mon May 02, 2016 8:25 pm
by KDJ
Instructor
Please add FRF_TEST in description of AkelPad.TextFind().
Posted: Mon May 16, 2016 4:18 pm
by Instructor
KDJ
Added.
Posted: Wed Jun 01, 2016 6:16 pm
by Instructor
KDJ wrote:When I try to close any modified document (from the script), then displays message box "Document was modified. Do you want to save it?" and AkelPad hangs. On Win-XP sometimes, and on Win-7 always.
With Scripts v18.5. CloseDocument.js:
Code: Select all
if (LoWord(wParam) == 1000)
{
AkelPad.ScriptNoMutex(0x20 /*ULT_UNLOCKSENDMESSAGE*/);
AkelPad.Command(4318 /*IDM_WINDOW_FRAMECLOSE*/);
AkelPad.ScriptNoMutex(0x10 /*ULT_LOCKSENDMESSAGE*/);
}