|
>半角英数字の前後に半角スペースを挿入するマクロは無いでしょうか。
昔のゴミですが ...
// gofiletop;
call pk_add_h_spc_z1;
endmacro;
$str_find1 = "[\x20-゚]\\f[\x81\x40-\xF0\x40]"; // 半角_全角
$str_find2 = "[\x81\x40-\xF0\x40]\\f[\x20-゚]"; // 全角_半角
replaceall $str_find1, "\\0\x20\\1", regular, inselect, ask;
replaceall $str_find2, "\\0\x20\\1", regular, inselect, ask;
endmacro;
$str_find = "[\x20-゚]\\f[\x81\x40-\xF0\x40]"; // 半角_全角
// $str_find = $str_find + "|[\x81\x40-\xF0\x40]\\f[\x20-゚]"; // 全角_半角
// replaceall $str_find, "\\0\x20\\1", regular, inselect, ask;
replaceall $str_find, "\\0@\\1", regular, inselect, ask; // test.
endmacro;
//*6MICRO pk_add_h_spc_z1
//*6_Desc. 半角文字と全角文字の間に、半角スペースを追加 Ver. 03.01
//*6 call pk_add_h_spc_z1;
//*6 return : N/A
//*6 [Tab] の考慮は無い。
endmacroall;
pk_add_h_spc_z1:
$str_find = "[\x20-゚\\n][\x81\x40-\xF0\x40]"; // 改行、半角_全角
$str_find = $str_find + "|[\x81\x40-\xF0\x40][\x20-゚\\n]"; // 全角_半
角、改行
//R $str_find = "[\x20-゚][\x81\x40-\xF0\x40]"; // 半角_全角
//R $str_find = $str_find + "|[\x81\x40-\xF0\x40][\x20-゚]"; // 全角_半角
searchdown $str_find, regular, inselect;
while( result ){
escape; moveto selendx , selendy; left;
if( ! #sw_shift ){
menu "add space !", "(&Y) Yes", "(&N) Next";
#menu = result - 1;
#sw_shift = iskeydown(0x10); // [Shift]
}
if( iskeydown( 0x1B ) ){ endmacro; } // [Esc]
if( #menu == 00 ){
endmacro;
} else if( #menu == 01 ){
insert "\x20"; left;
// insert "@"; left; // test.
} else if( #menu == 02 ){
left;
} else {
}
finddown;
}
return;
//*6MICRO_END
|
|