|
こんにちは安久津といいます。
(1)<%=???%>
// マクロ始まり
disabledraw; escape; ##cy = y;
$$date = date; $$time = time;// 日付と時刻に齟齬ないように
$$y = leftstr($$date,2);
if( $$y != "99" ){
$$year = "20" + $$y;
##y = val($$y) + 12; $$jyear = str(##y);
}else{
// もうすぐ、要らなくなる。
$$year = "1999"; $$jyear = "11";
}
call replaceDown "<%=jyear%>",$$jyear;
call replaceDown "<%=year%>",$$year;
$$d = midstr($$date,6,2);
call replaceDown "<%=jdate%>",$$d;// 間違え防止
call replaceDown "<%=date%>",$$d;
$$monthClass = "01|02|03|04|05|06|07|08|09|10|11|12|" +
"JanFebMarAprMayJunJulAugSepOctNovDec";
$$jmonth = midstr( $$date, 3, 2 );
##k = strstr( $$monthClass, $$jmonth );
$$month = midstr( $$monthClass, ##k + 36, 3 );
$$weekClass = "日|月|火|水|木|金|土|SunMonTueWedThuFriSat";
$$jweek = midstr( $$date, 9, 2 );
##k = strstr( $$weekClass, $$jweek );
$$week = midstr( $$weekClass, ##k + 21, 3 );
call replaceDown "<%=jmonth%>",$$jmonth;
call replaceDown "<%=jweek%>",$$jweek;
call replaceDown "<%=month%>",$$month;
call replaceDown "<%=week%>",$$week;
call replaceDown "<%=time%>",$$time;
call replaceDown "<%=path%>",getenv("path");
call replaceDown "<%=tz%>",getenv("tz");
call replaceDown "<%=filename2%>",filename2;
call replaceDown "<%=basename2%>",basename2;
call replaceDown "<%=directory2%>",directory2;
call replaceDown "<%=fontname%>",fontname;
call replaceDown "<%=fontsize%>",str(fontsize);
moveto 0, ##cy;
// changename ""; // newfile
beep;
endmacro;
replaceDown:
if( $$2 == "" ) $$2 = "<!-- "+midstr($$1,3,strlen($$1)-5)+" -->";
gofiletop;
replacedown $$1,$$2,casesense; // 大文字小文字区別
while( result ) finddown;
return;
// マクロおわり
データ例
<%=week%>, <%=date%> <%=month%> <%=year%> <%=time%>
平成<%=jyear%>年<%=jmonth%>月<%=jdate%>日 <%=jweek%>曜日 <%=time%>
(2)<%???%>
埋め込みマクロは、<hidemarumacro></hidemarumacro> 等で、
囲んでしまった方が簡単そうです。
ナンバリングだったら、それ自体を埋め込んでしまう。
<hidemarumacro>
#chapcount=1;
gofiletop;
replacedown "<%=chapcount%>","1",casesense;
while( result ){
#chapcount = #chapcount + 1;
replacedown "<%=chapcount%>",str(#chapcount),casesense;
}
</hidemarumacro>
ではでは。
|
|