Scripts discussion (1)
- Author
- Message
-
Offline
- Posts: 3234
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Thank you for your attention, I'll try to fix it.cnnnc wrote:When InsertText.js do with column selection In each of Selected, the result same as normal selection.
When InsertText.js do with column selection In Selection, the result is diffterent to normal selection.
My NumberCount.js can insert text and/or number to every selected line even column selection. but there are some bugs I unable to fix.
I agree, your script NumberCount.js is much better than mine.
Good idea with the numbers of lines. Congratulations.

-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
I fixed InsertText.js script and I added support for the columnar selection.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
-
Offline
- Site Admin
- Posts: 6403
- Joined: Thu Jul 06, 2006 7:20 am
VladSh wrote:Instructor
Только заметил, что скрипт GetFirstVisibleChar.js исчез. Задача всё та же (что по ссылке).
Code: Select all
var hWndEdit=AkelPad.GetEditWnd();
WScript.Echo("" + GetOffset(hWndEdit, 10 /*AEGI_FIRSTVISIBLELINE*/));
function GetOffset(hWndEdit, nType /*AEGI_*/)
{
var lpIndex;
var nOffset=-1;
if (lpIndex=AkelPad.MemAlloc(12 /*sizeof(AECHARINDEX)*/))
{
AkelPad.SendMessage(hWndEdit, 3130 /*AEM_GETINDEX*/, nType, lpIndex);
nOffset=AkelPad.SendMessage(hWndEdit, 3136 /*AEM_INDEXTORICHOFFSET*/, 0, lpIndex);
AkelPad.MemFree(lpIndex);
}
return nOffset;
}
-
Offline
- Site Admin
- Posts: 6403
- Joined: Thu Jul 06, 2006 7:20 am
KDJ wrote:How to read the begin and the end of selection and the caret offset?.
Code: Select all
var hWndEdit=AkelPad.GetEditWnd();
WScript.Echo("" + GetCharInLine(hWndEdit, 5 /*AEGI_CARETCHAR*/));
function GetCharInLine(hWndEdit, nType /*AEGI_*/)
{
var lpIndex;
var nCharInLine=-1;
if (lpIndex=AkelPad.MemAlloc(12 /*sizeof(AECHARINDEX)*/))
{
AkelPad.SendMessage(hWndEdit, 3130 /*AEM_GETINDEX*/, nType, lpIndex);
nCharInLine=AkelPad.MemRead(lpIndex + 8, 3 /*DT_DWORD*/);
AkelPad.MemFree(lpIndex);
}
return nCharInLine;
}
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
CalculatorJS.js now has a variable size window.
-
Offline
- Posts: 1292
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Amazing!KDJ wrote:CalculatorJS.js
Just one little correction: under Windows 7, the width of lpOutXYWH causes the Output Edit to intersect the Output type Combo. So I've changed this width from 471 to 469.
... and the function average seems to not working... It says 'Average' is undefined.
-
Offline
- Posts: 1292
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Great!KDJ wrote:DV thanks, I fixed it.
Just for information: a remarkable ability of the calculator engine powered by JScript is to use local or global variables anywhere in your calculations.
E.g.
Code: Select all
var a = 10, b = 5, x = a + b; sin(x)/x
Or just
Code: Select all
c = 100
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
In CalculatorJS, variables x, X, y, Y, z, Z are defined as global.
They are used to store cache memory of the calculator.
You can use them in calculations such as: 15*x+y-Z/12.
But you can not use to manual assignment eg.: x=50.
To change the contents of memory x, you must type as the expression 50 and use the button "Result to X". Then the value of 50 will be assignment to the variables x and X, and will be displayed in the window memory.
They are used to store cache memory of the calculator.
You can use them in calculations such as: 15*x+y-Z/12.
But you can not use to manual assignment eg.: x=50.
To change the contents of memory x, you must type as the expression 50 and use the button "Result to X". Then the value of 50 will be assignment to the variables x and X, and will be displayed in the window memory.
-
Offline
- Posts: 27
- Joined: Sun Mar 16, 2008 10:26 pm
Приветствую.
Пробую запустить InsertTextLN.js от KDJ -- получаю ошибку 800A1391 ("AkelPad" - определение отсутствует) в строке
Версия программы 4.1.10
В чём моя ошибка, подскажите, пожалуйста.
Пробую запустить InsertTextLN.js от KDJ -- получаю ошибку 800A1391 ("AkelPad" - определение отсутствует) в строке
Code: Select all
var hMainWnd = AkelPad.GetMainWnd();
В чём моя ошибка, подскажите, пожалуйста.