Macro/投稿/165
をテンプレートにして作成
Land.to
[
ホーム
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
* 等差数列の挿入 [#k550bc98]
-ページ: [[Macro/投稿]]
-作者: [[かくれんbぽ]]
-カテゴリー: ppa
-投稿日: 2007-02-09 (金) 10:38:43
** メッセージ [#ub34e205]
現在のカーソル位置から
・初期値
・差分
・繰り返し回数
・数値の左右に挿入する文字列
・数値を入力する方向
を指定して、等差数列を挿入します。
---------------------------------------
#code{{
//等差連番挿入
var
intCnt,intDef,intCount:integer;
strBuff,strDist,strLeft,strRight:string;
begin
strBuff := InputBox('初期値入力','連番の初期値を入力...
if( strBuff = '') then exit; ...
intCnt := StrToInt(strBuff); ...
strBuff := InputBox('差分入力','連番の差分を入力して...
if( strBuff = '') then exit;
intDef := StrToInt(strBuff); ...
repeat
strBuff := InputBox('繰り返し回数入力','繰り返す...
if( strBuff = '') then exit;
intCount := StrToInt(strBuff); ...
if( intCount <= 0 ) then ...
begin
intCount := MessageBox('繰り返し回数は1以上の...
'繰り返し回数 入力 エ...
if ( intCount = 2 ) then
exit ...
else
intCount := -1; ...
end;
until (intCount > 0); ...
strLeft := InputBox('左側挿入文字入力','数値の左側に...
// if( strLeft = '') then exit; ...
strRight := InputBox('右側挿入文字入力','数値の右側に...
// if( strRight = '') then exit;
strDist := InputBox('移動する方向を数字で入力してくだ...
if( strDist = '') then exit;
while ( intCount > 0 ) do
begin
S_MoveHistSet; ...
S_InsText ( strLeft + IntToStr(intCnt) + strRight...
if ( strDist = '8' ) then ...
begin
S_MoveHistPrev; ...
S_Up; ...
end
else if ( strDist = '2' ) then ...
begin
S_MoveHistPrev; ...
S_Down; ...
end
else if ( strDist = '4' ) then ...
S_MoveHistPrev ...
else ...
; ...
intCnt := intCnt + intDef; ...
intCount := intCount - 1; ...
end;
end;
}}
----
#comment
終了行:
* 等差数列の挿入 [#k550bc98]
-ページ: [[Macro/投稿]]
-作者: [[かくれんbぽ]]
-カテゴリー: ppa
-投稿日: 2007-02-09 (金) 10:38:43
** メッセージ [#ub34e205]
現在のカーソル位置から
・初期値
・差分
・繰り返し回数
・数値の左右に挿入する文字列
・数値を入力する方向
を指定して、等差数列を挿入します。
---------------------------------------
#code{{
//等差連番挿入
var
intCnt,intDef,intCount:integer;
strBuff,strDist,strLeft,strRight:string;
begin
strBuff := InputBox('初期値入力','連番の初期値を入力...
if( strBuff = '') then exit; ...
intCnt := StrToInt(strBuff); ...
strBuff := InputBox('差分入力','連番の差分を入力して...
if( strBuff = '') then exit;
intDef := StrToInt(strBuff); ...
repeat
strBuff := InputBox('繰り返し回数入力','繰り返す...
if( strBuff = '') then exit;
intCount := StrToInt(strBuff); ...
if( intCount <= 0 ) then ...
begin
intCount := MessageBox('繰り返し回数は1以上の...
'繰り返し回数 入力 エ...
if ( intCount = 2 ) then
exit ...
else
intCount := -1; ...
end;
until (intCount > 0); ...
strLeft := InputBox('左側挿入文字入力','数値の左側に...
// if( strLeft = '') then exit; ...
strRight := InputBox('右側挿入文字入力','数値の右側に...
// if( strRight = '') then exit;
strDist := InputBox('移動する方向を数字で入力してくだ...
if( strDist = '') then exit;
while ( intCount > 0 ) do
begin
S_MoveHistSet; ...
S_InsText ( strLeft + IntToStr(intCnt) + strRight...
if ( strDist = '8' ) then ...
begin
S_MoveHistPrev; ...
S_Up; ...
end
else if ( strDist = '2' ) then ...
begin
S_MoveHistPrev; ...
S_Down; ...
end
else if ( strDist = '4' ) then ...
S_MoveHistPrev ...
else ...
; ...
intCnt := intCnt + intDef; ...
intCount := intCount - 1; ...
end;
end;
}}
----
#comment
ページ名: