63000 : 63010 ' ******************* 63020 ' * 置換 * 63040 ' ******************* 63100 *O'コマンド入力 63110 行数%=peek($5E9)+1 '最大モニタ表示行数 63120 変数文字$=sum(I,$30,$39,chr$(I)) '数字+ 63130 変数文字$=変数文字$+sum(I,$41,$5A,chr$(I)) '英字+ 63140 変数文字$=変数文字$+sum(I,$A1,$DF,chr$(I)) '片仮名+ 63150 変数文字$=変数文字$+"_!#$%(" '他=変数名に使える文字 63160 kmode 1 63170 key 0,chr$(2,13) 63180 line input A$ 63190 A=instr(A$+",",",") 63200 if len(A$)=A then 範囲$=",-59999" 63210 if len(A$)>A then 範囲$=mid$(A$,A) 63220 if instr(A$,"V") then F変数=1 else F変数=0 63230 if instr(A$,"S") then F個別=1 else F個別=0 63240 print chr$(4); 63300 *O_置換文字入力 63310 repeat 63320 play "O8CRO7G" 63330 print "置換前 = ";置換前$,chr$(5,30) 63340 line input "置換前 = ";置換前$ 63350 if instr(置換前$,chr$(27)) then mid$(置換前$,instr(置換前$,chr$(27)),1)=" " 63360 置換前文字長%=len(置換前$) 63370 if 置換前文字長%=0 then 63380 key 0,chr$(30,24)+"G.*O_置換文字入力"+chr$(13) 63390 merge "MEM:置換前データ" 63400 end if 63410 print "置換後 = ";置換後$,chr$(5,30) 63420 line input "置換後 = ";置換後$ 63430 if instr(置換後$,chr$(27)) then mid$(置換後$,instr(置換後$,chr$(27)),1)=" " 63440 置換後文字長%=len(置換後$) 63450 if F変数 and right$(置換前$,1)="(" then HAI=1 else HAI=0 63460 until asc(置換後$)<=0 or 270 then 63730 前$=mid$(リスト$,A-1,1) 63740 if instr(変数文字$,前$) then F置換=0 '別の変数 63750 else 63760 F置換=0 '別の変数 63770 end if 63780 if HAI then 63790 else 63800 後$=mid$(リスト$+" ",A+置換前文字長%,1) 63810 if asc(後$)=>0 then 63820 if instr(変数文字$,後$) then F置換=0'別の変数 63830 else 63840 F置換=0 '別の変数 63850 end if 63860 end if 63870 end if 63880 if F置換=1 then 63890 print mid$(リスト$,B,A-B);chr$(5); 63900 print #2,mid$(リスト$,B,A-B); 63910 if F個別 then 63920 L=len(mid$(リスト$,A)) 63930 print [2] 置換前$; 63940 print mid$(リスト$,A+置換前文字長%);string$(L,29); 63950 KE$=input$(1) 63960 if instr("Yy"+chr$(13),KE$) else F置換=2 63970 end if 63980 if F置換=1 then 63990 print [4] 置換後$; 64000 print #2,置換後$; 64010 else 64020 print [6] 置換前$; 64030 print #2,置換前$; 64040 end if 64050 end if 64060 C=A+置換前文字長% 64070 A=instr(C,リスト$,置換前$) 64080 if F置換 then B=C 64090 F置換=1 64100 wend 64110 if B>1 then 64120 print mid$(リスト$,B);chr$(5) 64130 print #2,mid$(リスト$,B) 64140 end if 64150 wend 64160 print #2 64170 close 64180 key 0,chr$(30,24)+"G.*O_置換文字入力"+chr$(13) 64190 merge "MEM:置換後データ"