Macro/投稿/47
をテンプレートにして作成
Land.to
[
ホーム
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
* テキスト電卓+ [#ede5a3b1]
-ページ: [[Macro/投稿]]
-作者: [[りーや]]
-カテゴリー: pls
-投稿日: 2005-06-21 (火) 17:30:25
** メッセージ [#qcd3c3e2]
#code(perl){{
# eval.pls
$selStr = GetSelectedString(0);
unless($selStr){
MoveHistSet(); BeginSelect(); GoLineTop(1);
$selStr = GetSelectedString(0);
$selStr =~ /^(.+)\t(.*)$/;
if($2){
$selStr = $2;
$preFix = $1 . "\t";
}
}
if($selStr =~ /^(.+)=[ \t\r\n]*$/){
$outStr = eval $1;
$outStr = $selStr . $outStr;
} else {
$outStr = eval $selStr;
}
if($@){
use Win32::OLE;
$WshShell = Win32::OLE->CreateObject("WScript.Shell");
$WshShell->Popup("$selStr\n$@",undef,"Abend",0);
CancelMode(); MoveHistPrev();
exit;
} else {
InsText($preFix . $outStr);
}
}}
----
#comment
終了行:
* テキスト電卓+ [#ede5a3b1]
-ページ: [[Macro/投稿]]
-作者: [[りーや]]
-カテゴリー: pls
-投稿日: 2005-06-21 (火) 17:30:25
** メッセージ [#qcd3c3e2]
#code(perl){{
# eval.pls
$selStr = GetSelectedString(0);
unless($selStr){
MoveHistSet(); BeginSelect(); GoLineTop(1);
$selStr = GetSelectedString(0);
$selStr =~ /^(.+)\t(.*)$/;
if($2){
$selStr = $2;
$preFix = $1 . "\t";
}
}
if($selStr =~ /^(.+)=[ \t\r\n]*$/){
$outStr = eval $1;
$outStr = $selStr . $outStr;
} else {
$outStr = eval $selStr;
}
if($@){
use Win32::OLE;
$WshShell = Win32::OLE->CreateObject("WScript.Shell");
$WshShell->Popup("$selStr\n$@",undef,"Abend",0);
CancelMode(); MoveHistPrev();
exit;
} else {
InsText($preFix . $outStr);
}
}}
----
#comment
ページ名: