あれ?
WIN32API定数を以前にDLしたときには、"const.txt"は同梱されてなかった気が…
何にせよ、"const.txt"の重複部分を削ってインクルードするだけで万事解決じゃないですか!!!
てなわけで、重複デストロイヤーを作ってみました。
"const.txt"と同じフォルダ内で実行すると、"const.hsp"を生成します。
大体4〜5分で完走するので、試してみてください。
ちなみにマクロ定義は何億個定義してもファイルサイズに影響しません。
ここで自動生成される"const.hsp"のファイルサイズは1Mbくらいですが、
実行ファイルにすると173kbになりました。
それどころか最近のHSPは、使用しない命令や関数もコンパイル時に除外されるらしいですね。じゃんじゃんインクルードしましょう。
screen 0, 640, 480
title "重複デストロイヤー"
font msgothic, 12
Sourse = ""
Overlap = ""
notesel Sourse
noteload "const.txt"
repeat
noteget ChkLine, cnt
Len = strlen( ChkLine )
Index = instr( Sourse, 0, ChkLine ) + strlen( ChkLine )
gmode 0, ginfo_sx, ginfo_sy
pos 0, 20
gcopy 0
color 255,255,255
boxf 0,0,ginfo_sx,20
color 0,0,0
pos 0, 0
mes ChkLine
repeat
await 0
ThisIndex = instr( Sourse, Index, ChkLine )
if ThisIndex == -1 : break
ThisIndex += Index
Overlap += ChkLine + "\n"
Prior = strmid( Sourse, 0, ThisIndex )
Mid = strmid( Sourse, ThisIndex, strlen( ChkLine ) )
After = strmid( Sourse, ThisIndex + strlen( ChkLine ), strlen( Sourse ) )
Sourse = Prior + After
;mes ""+ThisIndex + "〜" + ( ThisIndex + strlen( ChkLine ) )
;mes "-"+Mid+"-"
loop
//HSP用例外処理
if ChkLine == "#define DELETE $00010000" : noteadd "#define _DELETE $00010000", cnt, 1
;DELETEはdelete命令で使用されている
if ChkLine == "#define AUX_a $00000061" : noteadd "#define AUX_SMALL_a $00000061", cnt, 1
if ChkLine == "#define AUX_b $00000062" : noteadd "#define AUX_SMALL_b $00000062", cnt, 1
if ChkLine == "#define AUX_c $00000063" : noteadd "#define AUX_SMALL_c $00000063", cnt, 1
if ChkLine == "#define AUX_d $00000064" : noteadd "#define AUX_SMALL_d $00000064", cnt, 1
if ChkLine == "#define AUX_e $00000065" : noteadd "#define AUX_SMALL_e $00000065", cnt, 1
if ChkLine == "#define AUX_f $00000066" : noteadd "#define AUX_SMALL_f $00000066", cnt, 1
if ChkLine == "#define AUX_g $00000067" : noteadd "#define AUX_SMALL_g $00000067", cnt, 1
if ChkLine == "#define AUX_h $00000068" : noteadd "#define AUX_SMALL_h $00000068", cnt, 1
if ChkLine == "#define AUX_i $00000069" : noteadd "#define AUX_SMALL_i $00000069", cnt, 1
if ChkLine == "#define AUX_j $0000006A" : noteadd "#define AUX_SMALL_j $0000006A", cnt, 1
if ChkLine == "#define AUX_k $0000006B" : noteadd "#define AUX_SMALL_k $0000006B", cnt, 1
if ChkLine == "#define AUX_l $0000006C" : noteadd "#define AUX_SMALL_l $0000006C", cnt, 1
if ChkLine == "#define AUX_m $0000006D" : noteadd "#define AUX_SMALL_m $0000006D", cnt, 1
if ChkLine == "#define AUX_n $0000006E" : noteadd "#define AUX_SMALL_n $0000006E", cnt, 1
if ChkLine == "#define AUX_o $0000006F" : noteadd "#define AUX_SMALL_o $0000006F", cnt, 1
if ChkLine == "#define AUX_p $00000070" : noteadd "#define AUX_SMALL_p $00000070", cnt, 1
if ChkLine == "#define AUX_q $00000071" : noteadd "#define AUX_SMALL_q $00000071", cnt, 1
if ChkLine == "#define AUX_r $00000072" : noteadd "#define AUX_SMALL_r $00000072", cnt, 1
if ChkLine == "#define AUX_s $00000073" : noteadd "#define AUX_SMALL_s $00000073", cnt, 1
if ChkLine == "#define AUX_t $00000074" : noteadd "#define AUX_SMALL_t $00000074", cnt, 1
if ChkLine == "#define AUX_u $00000075" : noteadd "#define AUX_SMALL_u $00000075", cnt, 1
if ChkLine == "#define AUX_v $00000076" : noteadd "#define AUX_SMALL_v $00000076", cnt, 1
if ChkLine == "#define AUX_w $00000077" : noteadd "#define AUX_SMALL_w $00000077", cnt, 1
if ChkLine == "#define AUX_x $00000078" : noteadd "#define AUX_SMALL_x $00000078", cnt, 1
if ChkLine == "#define AUX_y $00000079" : noteadd "#define AUX_SMALL_y $00000079", cnt, 1
if ChkLine == "#define AUX_z $0000007A" : noteadd "#define AUX_SMALL_z $0000007A", cnt, 1
;AUX_AとAUX_aは、大文字と小文字を区別しないHSPでは同一とみなされる。
if cnt >= notemax - 1 : break
loop
notesel Sourse
notesave "const.hsp"
notesel Overlap
notesave "overlap.hsp"
dialog "保存完了\n完成リスト -> \"const.hsp\"\n重複リスト -> \"overlap.hsp\""