|
>
>$MailSubject = "turukame.4:00001| マクロ作者のための会議室設置しました";
>$FileName = fixtofilename($MailSubject);
>
>てなようにすると、$Filename の中身が、ファイル名に使えない : と | を取り除
>いて
>
>"turukame.400001 マクロ作者のための会議室設置しました"
>
>のようにしたいということです。(んまあ本当はもうちょっと工夫をした方がいいか
>もしれませんが)
>
>※ファイル名に使うことのできない文字は、¥/:?"<>*| で全部でしたでしょうか?
>
力技でナンですが
------------------------------------------------------
$MailSubject = "turukame.4:00001| \\マクロ作者/のため/の**会議室設<置>しま\"
した";
call fixtofilename $MailSubject ;
$FileName = $$return;
message($MailSubject + char(0x0a) + $FileName);
endmacro;
fixtofilename:
$file = $$1;
call clearword $file, "|" ;
$file = $$return;
call clearword $file, "\\" ;
$file = $$return;
call clearword $file, "/" ;
$file = $$return;
call clearword $file, "|" ;
$file = $$return;
call clearword $file, ":" ;
$file = $$return;
call clearword $file, "?" ;
$file = $$return;
call clearword $file, "\"" ;
$file = $$return;
call clearword $file, "<" ;
$file = $$return;
call clearword $file, ">" ;
$file = $$return;
call clearword $file, "*" ;
$file = $$return;
return $file;
clearword:
$work = $$1;
$chr = $$2;
$fn = "";
#idx = strstr($work, $chr);
while( #idx != -1 ){
if( #idx != 0 ){
$fn = $fn + leftstr($work, #idx );
}
$w2 = midstr($work , #idx+1, strlen($work) - #idx -1);
$fn = $fn + $w2;
$work = $fn;
$fn = "";
#idx = strstr($work, $chr);
}
$fn = $work;
return $fn;
|
|