'整形解除(ベタテキスト化) / Ver. 0.50 / by Kabuneko 2000/05/02
'選択された部分について、改行を取ってつなぎます。
proc main
if @Select = 0 or @Select = 3 or @Select = 4 then exit proc
dim i, m, n, a$, c$, para$
'段落先頭文字・編集可
para$ = " 「"
if @ArticleIndent <> 0 then '箇条書きインデントがオンのとき
for i = 1 to 10 '箇条書き記号を取得
a$ = @Article$(i)
do while a$ <> ""
c$ = left$(a$,1) '空白以外の1文字目を切り出す
if c$ <> " " then
para$ = para$ + c$
exit do
else
a$ = mid$(a$,2)
end if
loop
next
end if
@Redraw = 0 '画面出力停止
@UndoBlock = 1 'UNDO をブロック化
m = @SelectStartLine '選択範囲の先頭位置
n = @SelectEndLine '選択範囲の末尾位置
@BlockSelectEnd
@Line = n '末尾から上に向かって処理
do while 1
do while 1
@MoveBeginningLine
if @Code = CODE_RETURN or @Code = CODE_EOF then exit do
if instr(para$, chr$(@Code)) > 0 then exit do
'行頭の半角スペースを削除
do while @Code = &h20
@DeleteChar
loop
@MoveLeftChar
if @XDisplay > 1 then @DeleteChar
if @Line <= m then exit do
loop
@MoveLeftChar
if @Line <= m then exit do
loop
@Line = m : @XDisplay = 1
@UndoBlock = 0
@Redraw = 1
end proc