; ; HSP help index build script ; onitama/onion software 1999 ; #include "hspda.as" ; Use Data-Access DLL #include "mod_hs.as" #packopt name "mkindex2" #packopt runtime "hsp2c.hrt" ; sdim cb_group,512 cb_group={"システム変数 プリプロセッサ命令 代入命令 特殊代入命令 プログラム制御命令 プログラム制御マクロ 基本入出力制御命令 拡張入出力制御命令 オブジェクト制御命令 画面制御命令 拡張画面制御命令 文字列操作命令 メモリ管理命令 マルチメディア制御命令 ファイル操作命令 拡張ファイル操作命令 通信制御命令 OSシステム制御命令 HSPシステム制御命令 その他の命令 "} ; tt="HSP help index builder ver0.85(html)" title tt chdir exedir ; EXEのあるディレクトリをカレントに ; wx=640:wy=480 screen 0,wx,wy,paluse gsel 0,1 sdim ih_msg,$50000 ; メッセージ表示バッファ(320K) sdim ih_list,$10000 ; リスト表示バッファ(64K) cls 1 objmode 1 ih_msg=tt ih_msg+="/ ONION software 1999-2001(c)\n" ih_lsel=0 ; sysfont 17 pos 2,wy-292 mesbox ih_msg,wx-6,286,1 ; ID0 pos 2,0 objsize 300,24 listbox ih_lsel,160,ih_list ; ID1 objsize 120,26 y=4 pos wx-330,y button "keyword表示",*main3 pos wx-130,y+38 button "html作成",*main4 pos wx-130,y+76 button "text作成",*main5 pos wx-130,y button "index作成",*main2 pos wx-130,y+146 button "終了",*owari *main0 ihelp_find "" ih_list = ih_ansbuf notesel ih_list notemax i ih_msg+="Total "+i+" keywords.\n" objprm 0,ih_msg objprm 1,ih_list *main stop *main2 ; index作成 ; gosub *mkidx goto *main0 *main3 ; keyword表示 ; sdim ln,256 if ih_lsel<0 : goto *main notesel ih_list noteget ln,ih_lsel if ln="" : goto *main ihelp_find "" ihelp_open ih_lsel ih_msg="["+ih_ans_key+"] "+ih_ans_title+"\n" if ih_fncprm="" : goto *nofnc ih_msg += ih_ans_key+" "+ih_fncprm+"\n" ih_msg += ih_prminf+"\n" if ih_ans_dll!="" : ih_msg+="("+ih_ans_dll+"が必要です)\n" *nofnc ih_msg+="\n"+ih_info+"\n" ; objprm 0,ih_msg goto *main *kw2lnk2 ; keyword->filename 変換 ; fc=0 fc2=" " peek fc,t,0 poke fc2,0,fc if (fc<'a')|(fc>'z') : fc2="sp" if fc='#' : peek t,t,1 ; 6文字以内にする(廃止) ;if fc='#' : fc=1 : else : fc=0 ;strmid t,t,fc,6 t="help_"+fc2+".htm#s_"+t return *makehtm ; html生成sub ; t=ih_ans_key fc=0 peek fc,t,0 if fc='#' : peek t,t,1 wrt+="\n" wrt+="

"+ih_ans_key ; wrt += "

\n" ; if ih_group="" : goto *nofprm4 wrt+="( "+ih_group+" )\n" *nofprm4 wrt += "
\n"
	;
	if ih_fncprm!="" : goto *fprm
	;
	wrt += "["+ih_ans_title+"]\n"
	wrt += "
\n" goto *nofprm2 *fprm wrt += ih_ans_key+" "+ih_fncprm+" ["+ih_ans_title+"]\n" wrt += "\n" if ih_prminf="" : goto *nofprm2 wrt += "
\n" i=0 notesel ih_prminf notemax i repeat i noteget ln,cnt wrt += ln+"
\n" loop wrt += "
\n" *nofprm2 if ih_ans_dll="" : goto *nofprm3 wrt+="
( 拡張プラグイン["+ih_ans_dll+"]が必要です )
\n" *nofprm3 wrt += "
\n" wrt += "
\n" ;sz=0 ;strlen sz,wrt ;bsave fname2,wrt,sz ; return *main4 ; html作成main ; sdim cbline,256 ih_htmopt=1 ihelp_find "" ansmax=0 ih_msg="Working...\n" objprm 0,ih_msg await 0 notesel ih_ansbuf notemax ansmax ;goto *mklog sdim ln,256 sdim wrt,$100000 ; idx書き出しバッファ(640K) ; fname2="hsphelp.htm" ; cc="":cofs=0:ccasc=0 repeat ansmax sdim wrt,$10000 ; idx書き出しバッファ(64K) ihelp_open cnt strmid cc,ih_ans_key,0,1 peek ccasc,cc,0 if (ccasc<'a')|(ccasc>'z') : cc="sp" fname2 ="help_"+cc+".htm" exist fname2 cofs=strsize if cofs<0 { wrt="HSP command help\n" wrt+="\n" wrt+="\n" cofs=0 } t=ih_ans_key:gosub *kw2lnk2 gosub *makehtm ;ih_msg+="["+fname2+"] process.\n" sz=0 strlen sz,wrt if cofs=0 { bsave fname2,wrt,sz } else { bsave fname2,wrt,sz,cofs } loop ;sz=0 ;strlen sz,wrt ;bsave fname2,wrt,sz ih_msg+="Total "+ansmax+" html created.\n" *mklog ; catalog作成 ; sdim wrt,$18000 fname2="hspref.htm" fref="" ; wrt="HSP ver2 (Hot Soup Processor)\n" wrt+="\n" wrt+="\n" ; notesel cb_group notemax cbmax repeat cbmax notesel cb_group noteget cbline,cnt wrt+="
  • "+cbline+"
    \n" loop ; wrt+="\n" sz=0 strlen sz,wrt bsave fname2,wrt,sz ih_msg+=fname2+" created.\n" ; 索引を作成 ; sdim wrt,$18000 fname2="hsppidx.htm" ; wrt="HSP ver2 (Hot Soup Processor)\n" wrt+="\n" wrt+="\n" ; wrt+="

  • 命令索引
  • \n" wrt+="\n" wrt+="\n" sz=0 strlen sz,wrt bsave fname2,wrt,sz ih_msg+=fname2+" created.\n" ; ; frame索引を作成 ; sdim wrt,$18000 fname2="hsppidxf.htm" ; wrt="HSP ver2 (Hot Soup Processor)\n" wrt+="\n" wrt+"\n wrt+"\n wrt+"\n wrt+="\n" ; wrt+="

    命令索引

    \n" repeat ansmax ihelp_open cnt t=ih_ans_key:gosub *kw2lnk2 wrt+= "" wrt+=ih_ans_key wrt+="
    \n" loop ; wrt+="\n" sz=0 strlen sz,wrt bsave fname2,wrt,sz ih_msg+=fname2+" created.\n" ; objprm 0,ih_msg ih_htmopt=0 ; goto *main *main5 ; full text作成main ; sdim cbline,256 ih_htmopt=0 ihelp_find "" ansmax=0 ih_msg="Working...\n" objprm 0,ih_msg await 0 fname2="help_all.txt" exist fname2 if strsize>=0 : delete fname2 notesel ih_ansbuf notemax ansmax repeat ansmax ihelp_open cnt t=ih_ans_key gosub *maketxt loop ih_msg+="Total "+ansmax+" keywords generated.\n" ; objprm 0,ih_msg ; goto *main *maketxt ; text生成sub ; sdim ln,256 sdim wrt,$18000 ; idx書き出しバッファ(96K) ; if ih_opt="" : goto *notlink if ih_opt="ver2.6標準命令" : goto *notlink wrt=ih_ans_key+"\n\n" ; if ih_fncprm!="" : goto *tfprm ; ;wrt += "["+ih_ans_title+"]\n\n" goto *notfprm2 *tfprm goto *notfprm2 ;wrt += ih_ans_key+" "+ih_fncprm+"\t\t["+ih_ans_title+"]\n" if ih_prminf="" : goto *notfprm2 i=0 notesel ih_prminf notemax i repeat i noteget ln,cnt wrt += ln+"\n" loop wrt += "\n" *notfprm2 *notfprm3 ;wrt += "・説明\n\n" ;wrt += ih_info ;wrt += "\n" if ih_opt!="" { if ih_opt!"ver2.6標準命令" { wrt += "\n※"+ih_opt+"\n\n" } } goto *notlink wrt += "\n" i=0 notesel ih_refinf notemax i if i<1 : goto *notlink wrt += "・参照\n\n" repeat i notesel ih_refinf noteget ln,cnt t=ln:gosub *kw2lnk2 notesel ih_refsel noteget ln,cnt+1 wrt += "->" + ln + "\n" loop *notlink ; ;wrt += "\n--------------------------------------------------------\n\n" ;wrt+="\n\n" sz=0 exist fname2 ofs=strsize strlen sz,wrt bsave fname2,wrt,sz,ofs ; return *owari end *mkidx ; idxファイル再構築main ; ih_msg="idxファイルの更新中...\n" fname2="hsphelp.idx" ; 書き出しファイル sdim tidx1,$10000 ; idx一時バッファ(64K) sdim tidx2,$10000 ; idx一時バッファ(64K) sdim wrt,$18000 ; idx書き出しバッファ(96K) sdim fl,$4000 dirlist fl,"*.hs",1 notesel fl notemax flmax if flmax=0 : goto *main2x flnum=0 *lp2 ; "*.hs"をすべて解析 ; notesel fl noteget fname1,flnum gosub *docstart flnum++ if flnum=bufmax : goto *doc2 ; error check ; tidx1+=a+"\n" tidx2+=""+idn+","+fname1+","+dllname+","+ln+"\n" *doc2 if i