Page 48 of 97

Posted: Fri Jan 07, 2011 7:08 pm
by Instructor
Добавлено: шаблоны в SearchReplace.js.

Added: templates to SearchReplace.js.

Posted: Fri Jan 07, 2011 7:30 pm
by FeyFre
Instructor
Хорошо бы на окно где-то сбоку добавить мануальчик по регулярным выражениям(список ключей), а то бывает как приспичит что-то поискать, так и с головы вылетает синтаксис... Ну или путается с другими движками(перловский, пхп-шный, Microsoft-овский, другие не столь популярные, но используемые), попробуй уследи за ними...

Posted: Fri Jan 07, 2011 7:54 pm
by Infocatcher
Instructor
Отлично!
А теперь самое время или навелосипедировать читалку ini-файлов, или встроить ее в плагин.

Posted: Fri Jan 07, 2011 8:10 pm
by FeyFre
Infocatcher
Читалка(и даже писалка) есть встроенная в редактор см. AKD_INIOPEN(по моему я где-то это уже писал)

Posted: Fri Jan 07, 2011 8:13 pm
by Infocatcher
FeyFre
Мне по-прежнему кажется, что должен быть простой интерфейс, чтобы в каждом скрипте не нужно было плодить функции-обертки (и чтобы не было зависимостей от скриптов-модулей).

Posted: Fri Jan 07, 2011 9:03 pm
by KDJ
cnnnc wrote:2KDJ
FileInfo.js is very good. But when I change the pString into Chinese, the result of stats isn't align like before.
Because of Chinese Character is DoubleByteChar, it seem a Chinese-Char's width equal two latin's.
I suggest one more line of code for support that, like this:

Code: Select all

function Pad(pString, nLen, pType, pChar)
{
  nLen = nLen - pString.replace(/[\u0000-\u00ff]/g,"").length;
Thank you for your interest in the script. I'm glad it can be helpful.
I do not quite understand the problem. In European languages, some characters are encoded on two bytes. For example, Polish char Ą has a code 0x104, Russian characters have codes in the range 0x401 - 0x451. But in the editor are displayed as a single character.
Maybe the problem is in the font.
You should use a fixed-width font (monospace).
But I do not know if there are such a font for Chinese.
Courier New and Lucida Console, unfortunately, do not contain Chinese characters.
Search in the internet "monospace unicode".

Posted: Fri Jan 07, 2011 9:19 pm
by Infocatcher
KDJ

Code: Select all

WScript.Echo("abc\n\uff41\uff42\uff43");

Arial Unicode MS: Image
Courier New: Image
Segoe UI (default UI font in Win 7): Image
Segoe UI in system dialog (all other – in AkelPad): Image

Posted: Fri Jan 07, 2011 9:36 pm
by KDJ
Instructor
What happened is that the script FontIniSize.vbs is not working properly in AkelPad 4.5.2?
In version 4.5.1 works correctly.

Posted: Fri Jan 07, 2011 10:10 pm
by KDJ
Infocatcher
Is the font Segoe UI is a fixed width? It looks as if it was not.

Posted: Fri Jan 07, 2011 10:13 pm
by Infocatcher
KDJ wrote:Is the font Segoe UI is a fixed width? It looks as if it was not.
No, but I don't have fixed width font with full Unicode support. Just for example. :)

Posted: Sat Jan 08, 2011 11:21 am
by opk44
KDJ wrote:Instructor
What happened is that the script FontIniSize.vbs is not working properly in AkelPad 4.5.2?
In version 4.5.1 works correctly.
1) Looks like condition in "If ... End If" not working at all (always TRUE). So "WScript.Quit" is always run.
2) Maybe mistake in

Code: Select all

pIniFile    = (AkelPad.GetAkelDir & "\\AkelPad.ini")
(Two slashes instead of one)

Posted: Sat Jan 08, 2011 12:15 pm
by KDJ
opk44 wrote:
KDJ wrote:Instructor
What happened is that the script FontIniSize.vbs is not working properly in AkelPad 4.5.2?
In version 4.5.1 works correctly.
1) Looks like condition in "If ... End If" not working at all (always TRUE). So "WScript.Quit" is always run.
2) Maybe mistake in

Code: Select all

pIniFile    = (AkelPad.GetAkelDir & "\\AkelPad.ini")
(Two slashes instead of one)
1) You're right.
If (hEditWnd = 0) Then
WScript.Quit
End If
Condition is always true.
Even if hEditWnd = 6845175. So 6845175 = 0.
It's probably a bug in AkelPad. This applies script in VBS. A similar script in the JS is working properly.

2) However, when it comes to a double slash "\\AkelPad.ini", it must be. To enter the slash in the string, you must precede the slash. So they must be two slashes.

Posted: Sat Jan 08, 2011 12:46 pm
by opk44
KDJ wrote:2) However, when it comes to a double slash "\\AkelPad.ini", it must be. To enter the slash in the string, you must precede the slash. So they must be two slashes.
I'm not sure that in VBS "it must be". Take a look, please, at that short vbs-script for example:

Code: Select all

AkelPad.MessageBox 0, AkelPad.GetAkelDir & "\\AkelPad.ini", "Test_double_slash_messagebox", 64
AkelPad.MessageBox 0, AkelPad.GetAkelDir & "\AkelPad.ini", "Test_single_slash_messagebox", 64

Posted: Sat Jan 08, 2011 1:24 pm
by KDJ
opk44
Thank you, you're right.
This is what I wrote applies to JS, but not to VBS.
I've already fixed the script, but it still does not work.

Posted: Sat Jan 08, 2011 2:17 pm
by KDJ
Now I see that none of the VBS scripts do not work.
Runtime error is generated:
"Variable uses an Automation type not supported in VBScript".
This also applies to Test.vbs script.