'//============================================================================== '// 概要 :各行の文字列で、クリップボードの#を置換し書き換える '// 作成日 :2008-11-吉日 '// 履歴 : '//============================================================================== '// 例1) [クリップボード] $# = '#'; '// あああ '// abc '// 123 '// */#aaaa '//  ↓↓↓ '// $あああ = 'あああ'; '// $abc = 'abc'; '// $123 = '123'; '// $*/#aaaa = '*/#aaaa'; '// 例2) [クリップボード] $sql .= ' # '; '// SELECT * '// FROM tbl1 '// WHERE "aaaa" is null '//  ↓↓↓ '// $sql .= ' SELECT * '; '// $sql .= ' FROM tbl1 '; '// $sql .= ' WHERE "aaaa" is null '; '//============================================================================== ' 現在のクリップボードのデータを取得 strClipdata = clipboardData.getData("Text") if strClipdata <> "" then Do document.selection.StartOfLine false ' 現在行を取得 strLine = document.GetLine(document.selection.GetActivePointY( eePosLogical )) ' マクロ終了判定 ' 何もない行かどうか判定 strtemp = strLine strtemp = REPLACE(strtemp,Chr(9),"") strtemp = REPLACE(strtemp," ","") strtemp = REPLACE(strtemp," ","") if strtemp = "" then exit do end if ' #を置換 strvalue = replace(strClipdata,"#",strLine) ' 行を書き換える document.selection.StartOfLine false document.selection.EndOfLine true document.selection.Delete 1 document.selection.Text=strvalue ' マクロ終了判定2 ' 最終行かどうか if document.GetLines = document.selection.GetActivePointY( eePosLogical ) then exit do end if '次の行へ document.selection.LineDown false,1 loop end if