61000 : 61010 ' ******************* 61020 ' * インデント * 61040 ' ******************* 61100 *D '初期設定 61110 init "EMM:" 'ファイルバッファ初期化 61120 基準%=5 '現在の字下げ量 61130 STE=20 'ステートメント用カウンタ 61140 dim STE$(STE) 'ステートメントデータ 61150 dim S_LEN(STE) 'ステートメント長 61160 dim 本増%(STE) 'その行を字下げする変化量 61170 dim 次増%(STE) '次の行を字下げする変化量 61180 restore *D 61190 I=0 61200 repeat 61210 read STE$(I),本増%(I),次増%(I) 61220 S_LEN(I)=len(STE$(I)) 61230 I=I+1 61240 until STE$(I-1)="end" 61250 STE=I-2 61260 data "else if" ,-4, 0 61270 data "else" ,-2, 2 61280 data "end if" ,-2,-2 61290 data "*" ,-5, 5 61300 data ":" ,-5, 5 61310 data "resume next", 2, 2 61320 data "repeat on" ,-2,-2 61330 data "for" , 2, 2 61340 data "while" , 2, 2 61350 data "repeat" , 2, 2 61360 data "next" ,-2,-2 61370 data "wend" ,-2,-2 61380 data "until" ,-2,-2 61390 data "then" , 2, 2 61400 data "end" , 0, 0 'ダミーデータ 61500 *D_コマンド処理 61510 key 0,chr$(30,13) 61520 line input A$ 61530 A=instr(A$+",",",") 61540 if len(A$)=A then 範囲$=",-59999" 61550 if len(A$)>A then 範囲$=mid$(A$,A) 61560 print "list ";chr$(34);"EMM:段付け前データ";chr$(34);範囲$;chr$(5) 61570 key 0,chr$(30,30,30,13,30)+"G.*D_続き"+chr$(5,13) 61580 stop 61600 *D_続き 61610 print "字下げ計算中" 61620 open "i",#1,"EMM:字下げ前データ" 61630 open "o",#2,"EMM:字下げ後データ" 61640 line input #1,A$ 61650 while A$>"" 61660 NO$=left$(A$,6) 61670 J=7 61680 while mid$(A$,J,1)=" ":J=J+1:wend 61690 B$=mid$(A$,J) 61700 A$=B$ 61710 K=0 61720 本行%=0 'その行を字下げする量 61730 次行%=0 '次の行を字下げする量 61740 if left$(A$,4)="data" then 61750 J=255 '字下げしない 61760 else if left$(A$,1)="'" then 61770 J=255 '字下げしない 61780 else 61790 for I=0 to STE-1 61800 if left$(A$,S_LEN(I))=STE$(I) then 61810 if I<>5 and I<>6 then 61820 本行%=本行%+本増%(I) 61830 次行%=次行%+次増%(I) 61840 end if 61850 if I=10 then J=0:gosub *NEXT 61860 K=S_LEN(I)+1 61870 I=STE 61880 end if 61890 next I 61900 for I=5 to STE-1 61910 J=instr(K,A$,STE$(I)) 61920 while J 61930 if 本行%=0 then 61940 本行%=本行%+本増%(I) 61950 次行%=次行%+次増%(I) 61960 else if 本行%>0 or 本増%(I)>0 then 61970 次行%=次行%+本増%(I)+次増%(I) 61980 else 61990 本行%=本行%+本増%(I)+次増%(I) 62000 end if 62010 if I=12 gosub *NEXT 62020 J=instr(J+S_LEN(I),A$,STE$(I)) 62030 wend 62040 next I 62050 J=instr(A$,STE$(STE)) 'then 62060 if J then 62070 J=J+4 62080 while mid$(A$,J,1)=" ":J=J+1:wend 62090 if len(A$)<=J or mid$(A$,J,1)="'" then 62100 本行%=本行%+本増%(STE) 62110 次行%=次行%+次増%(STE) 62120 end if 62130 end if 62140 end if 62150 if 基準%+本行%<0 then 本行%=0 62160 print #2,NO$+spc(基準%+本行%)+B$ 62170 基準%=基準%+本行%+次行% 62180 line input #1,A$ 62190 wend 62200 print #2,chr$(13) 62210 close 62220 print time 62230 print "DEL. ";mid$(範囲$,2) 62240 key 0,chr$(30,30,30,13,30)+"G.*D_MERGE"+chr$(5,13) 62250 stop 62300 *D_MERGE 62310 print "プログラム書き替え中" 62320 merge "EMM:字下げ後データ" 62330 return 62400 *NEXT 62410 D$=left$(A$+" ",instr(A,A$+":",":")) 62420 if D$>"" then 62430 C$=left$(D$,instr(A,D$+"'","'")-1) 62440 C=instr(J,C$,",") 62450 while C 62460 本行%=本行%+本増%(I)+次増%(I) 62470 次行%=+次増%(I) 62480 C=instr(C+1,C$,",") 62490 wend 62500 end if 62510 return