S_GetLineCountの使用例
//sample.js
//空行をカウントする
var iLine = 0;
var iCount = 0;
var iMax = GetLineCount(0); //論理行数を取得
while (++iLine <= iMax){ //全行をループ
if (GetLineStr(iLine).match(/[^\t ]+/) == 0){
iCount++;
}
}
var oWsh = new ActiveXObject("WScript.Shell");
oWsh.Popup(iCount, 0, "", 0);
//sample.ppa
//最大桁数を調べる
var
iCount : integer;
iLen : integer;
iMax : integer;
begin
iCount := S_GetLineCount(0); //行数取得
while iCount do
begin //全行ループ
iLen := Length( S_GetLineStr(iCount) );
if iMax < iLen then iMax := iLen;
iCount := iCount - 1;
end;
MessageBox(IntToStr(iMax), '最大桁数', 0);
end;