Scripts discussion (1)
- Author
- Message
-
Offline
- Posts: 2247
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
Instructor
Хорошо бы на окно где-то сбоку добавить мануальчик по регулярным выражениям(список ключей), а то бывает как приспичит что-то поискать, так и с головы вылетает синтаксис... Ну или путается с другими движками(перловский, пхп-шный, Microsoft-овский, другие не столь популярные, но используемые), попробуй уследи за ними...
Хорошо бы на окно где-то сбоку добавить мануальчик по регулярным выражениям(список ключей), а то бывает как приспичит что-то поискать, так и с головы вылетает синтаксис... Ну или путается с другими движками(перловский, пхп-шный, Microsoft-овский, другие не столь популярные, но используемые), попробуй уследи за ними...
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
Instructor
Отлично!
А теперь самое время или навелосипедировать читалку ini-файлов, или встроить ее в плагин.
Отлично!
А теперь самое время или навелосипедировать читалку ini-файлов, или встроить ее в плагин.
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Thank you for your interest in the script. I'm glad it can be helpful.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;
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".
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
KDJ
Code: Select all
WScript.Echo("abc\n\uff41\uff42\uff43");
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
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.
What happened is that the script FontIniSize.vbs is not working properly in AkelPad 4.5.2?
In version 4.5.1 works correctly.
-
Offline
- Posts: 1862
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
1) Looks like condition in "If ... End If" not working at all (always TRUE). So "WScript.Quit" is always run.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.
2) Maybe mistake in
Code: Select all
pIniFile = (AkelPad.GetAkelDir & "\\AkelPad.ini")
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
1) You're right.opk44 wrote:1) Looks like condition in "If ... End If" not working at all (always TRUE). So "WScript.Quit" is always run.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.
2) Maybe mistake in(Two slashes instead of one)Code: Select all
pIniFile = (AkelPad.GetAkelDir & "\\AkelPad.ini")
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.
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm