fb:porticula NoPaste
Automat. Setzung von Abständen f. Basic-Code
Uploader: | Michael Frey |
Datum/Zeit: | 09.10.2005 17:53:59 |
'Autor: Michael Frey
defint a-z
cls
PRINT "Tab Groesse?"
input tabg
open command$ for input as #1
open command$+".new" for output as #2
do until eof(1)
line input #1, x$
x$=trim$(x$)
y$=lcase$(x$)
'Kommentare ignorien
a = instr$(y$, "'")
if a then y$=trim$(left$(y$,a-1))
if left$(y$,2)= "if" then
if instr$(y$,"then")+3=len(y$) then r0 += 1
elseif left$(y$,6)= "elseif" then
r1 = -1
elseif left$(y$,4)= "else" then
r1 = -1
elseif left$(y$,6)= "end if" then
r0 -= 1
r1 = -1
elseif left$(y$,2)= "do" then
r0 += 1
elseif left$(y$,4)= "loop" then
r0 -= 1
r1 = -1
elseif left$(y$,5)= "while" then
r0 += 1
elseif left$(y$,4)= "wend" then
r0 -= 1
r1 = -1
elseif left$(y$,6)= "select" then
r0 += 1
elseif left$(y$,4)= "case" then
r1= -1
elseif left$(y$,10)= "end select" then
r0 -= 1
r1 = -1
elseif left$(y$,3)= "for" then
r0 += 1
elseif left$(y$,4)= "next" then
r0 -= 1
r1 = -1
end if
r += r1
r1 = 0
? #2,rtrim$(space$(r*tabg)+x$)
r = r0
loop
close