AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts plugin
Goto page Previous  1, 2, 3 ... 68, 69, 70, 71  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Kley



Joined: 28 Mar 2015
Posts: 202
Location: Russia

PostPosted: Tue Mar 01, 2016 5:22 pm    Post subject: Reply with quote

VladSh
VladSh wrote:
В GetArgValue не берётся значение по умолчанию при передаче пустой строки.

Code:
"test" Call("Scripts::Main", 1, "test.js", `-arg=""`)

Это параметр - Пустая строка. А это по умолчанию
Code:
"test" Call("Scripts::Main", 1, "test.js")
"test" Call("Scripts::Main", 1, "test.js", `-arg="default_text"`)

Надо же, как-то, передавать пустую строку Smile
Back to top
View user's profile Send private message
VladSh



Joined: 29 Nov 2006
Posts: 3075
Location: Киев, Русь

PostPosted: Tue Mar 01, 2016 6:32 pm    Post subject: Reply with quote

Kley wrote:
Надо же, как-то, передавать пустую строку Smile
Зачем? Smile Была когда-то такая необходимость? За всю историю не припомню.

"По умолчанию" - это 2-й параметр в GetArgValue. Если по умолчанию нужна пустая строка, то там и ставим "".


Добавлено: Хотя... логика понятна.
Back to top
View user's profile Send private message Visit poster's website
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Tue Mar 08, 2016 2:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sat Apr 23, 2016 12:40 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sat Apr 23, 2016 12:40 am    Post subject: Reply with quote

Добавлено: флаг 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
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Sat Apr 23, 2016 2:50 pm    Post subject: Reply with quote

Instructor
How to use RRF_TEST to get the count of all occurrences?
This code returns zero:
Code:
WScript.Echo(AkelPad.TextReplace(0, "a", "b", 0x00200001 /*FRF_DOWN|FRF_BEGINNING*/, 0x2 /*RRF_TEST*/));
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sat Apr 23, 2016 3:08 pm    Post subject: Reply with quote

KDJ
Code:
0x3 /*RRF_ALL|RRF_TEST*/
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Sat Apr 23, 2016 3:43 pm    Post subject: Reply with quote

Instructor
But RRF_ALL|RRF_TEST replaces all occurences.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Sat Apr 23, 2016 9:51 pm    Post subject: Reply with quote

KDJ
Test version
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Sun Apr 24, 2016 1:28 pm    Post subject: Reply with quote

Instructor
Works fine, thank you very much.
Back to top
View user's profile Send private message
VladSh



Joined: 29 Nov 2006
Posts: 3075
Location: Киев, Русь

PostPosted: Sun Apr 24, 2016 6:28 pm    Post subject: Reply with quote

Instructor
Если взялись за функционал поиска, то не могли бы Вы заодно добавить флаг в AkelPad.TextFind, чтобы, задать методу не выделять найденную строку, а просто возвращать номер позиции?
Back to top
View user's profile Send private message Visit poster's website
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Thu Apr 28, 2016 5:29 am    Post subject: Reply with quote

KDJ
RRF_TEST replaced with FRF_TEST.

VladSh
См. флаг FRF_TEST. Требуется разрабатываемая версия.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1919
Location: Poland

PostPosted: Mon May 02, 2016 8:25 pm    Post subject: Reply with quote

Instructor
Please add FRF_TEST in description of AkelPad.TextFind().
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Mon May 16, 2016 4:18 pm    Post subject: Reply with quote

KDJ
Added.
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6223

PostPosted: Wed Jun 01, 2016 6:16 pm    Post subject: Reply with quote

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:
    if (LoWord(wParam) == 1000)
    {
      AkelPad.ScriptNoMutex(0x20 /*ULT_UNLOCKSENDMESSAGE*/);
      AkelPad.Command(4318 /*IDM_WINDOW_FRAMECLOSE*/);
      AkelPad.ScriptNoMutex(0x10 /*ULT_LOCKSENDMESSAGE*/);
    }
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... 68, 69, 70, 71  Next
Page 69 of 71

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group