"
print #2,""
l=1:c=0
while eof(1)=0
a$=""
file input #1,a$
a$=replacesubstr(a$,"#","" )
'start section
if c=1 then: t$=trim(left$(a$,len(a$))): mkdir(base$+"/"+t$): a$=""+a$+"": c=0: end if
if left$(a$,5)="_____" then: a$="": c=1: end if
if left$(trim$(a$),1)="*" and left$(trim$(a$),2)<>"**" then
a$="
"+a$+"
"
end if
if left$(trim$(a$),2)="**" then
a$="
"+a$+"
"
end if
if left$(trim$(a$),1)="?" then
a$="
"+a$+"
"
end if
if left$(trim$(a$),2)="->" then
a$="
"+a$+"
"
end if
s=instr(a$,": ")
if s<>0 then
b$=left$(a$,s)
c$=mid$(a$,s+1)
a$=""+b$+""+c$
com$=rtrim$(left$(b$,len(b$)-1))
if instr(com$,"[")then: com$=left$(com$,instr(com$,"[")-1):end if
if instr(com$,"(")then: com$=left$(com$,instr(com$,"(")-1):end if
com$=rtrim(com$)
com$=replacesubstr(com$,chr$(9),"")
com$=replacesubstr(com$,"?","")
com$=replacesubstr(com$,"--","<")
if left$(trim$(com$),1)<>"<" then
print #3,com$ &" \\"
end if
if makeexamples<>0 then
if not fileexists(base$+"/"+t$+"/"+replacesubstr$(com$,"*","")+".sdlbas") and left$(trim$(com$),1)<>"<" then
open (base$+"/"+t$+"/"+replacesubstr$(com$,"*","")+".sdlbas") for output as 3
print base$+"/"+t$+"/"+replacesubstr$(com$,"*","")+".sdlbas"
print #3,"'"
print #3,"' sdlbasic example "+t$+":"+com$
print #3,"'"
print #3,"' name: "+com$+".sdlbas"
print #3,"' purpose: "+c$
print #3,"' author: __vroby__ ( __vroby__@libero.it )"
print #3,"' licence: lgpl"
print #3,"'"
print #3,"'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
close 3
end if
end if
end if
print #2,a$+" "
locate(0,0)
prints("line"+str$(l)+" ")
l=l+1
'waitvbl
end while
print #2,""
print #2,"
"
print #2,""
print #2,""
close 2
close 1
-------------------------------------------------- making api file for ide
if cleanapi=false then
filecopy("sdlBasic.txt",apiFile)
else
------------------ cleanup sdlbasic.api while copying it
outputfile$=apiFile
open inputfile$ for input as 1
open outputfile$ for output as 2
while eof(1)=0
file input #1,a$
for n = 1 to 10
if instr( a$, chr(09) )<>0 then
a$=replacesubstr( a$,chr(09),"" )
end if
next
if left$( a$, 1 )<>"#" then
file output #2,a$
end if
wend
close 2
close 1
end if
waitkey