dim alter(26)
alter(0)=103
alter(1)=70
alter(2)=66
alter(3)=61
alter(4)=166
alter(5)=66
alter(6)=2166
alter(7)=66
alter(8)=166
alter(9)=66
alter(10)=166
alter(11)=66
alter(12)=0
alter(13)=0
alter(14)=1000
alter(15)=1000
alter(16)=1000
alter(17)=1000
alter(18)=1000
alter(19)=1000
alter(20)=1000
alter(21)=1000
alter(22)=1000
alter(23)=1000
alter(24)=1000
alter(25)=5
ueberschrift$="Statistik V0.1"
abstand=50
abstand2=abstand-6
startpunkt=7
DiagrammTyp=1
AbstandLinks=9
for groesseArray=0 to arraysize(alter(), 1)-1
	if(alter(groesseArray)>maximum) maximum = alter(groesseArray)
next groesseArray
unten=maximum+100
BreiteView=groesseArray*abstand
if (BreiteView<600) then
	BreiteView=610
fi
BreiteFenster=800
BreiteView2=BreiteFenster-115
print BreiteView
jj=BreiteFenster-BreiteView
window open 100,100 to 800,500, "MainView", "Statistik"
view 0,0 to 685,385, "test1", "MainView"
SCROLLBAR "Diagramm", 3, "test1"
SCROLLBAR SET "Diagramm", "Vertical Range", 0, unten-370
SCROLLBAR SET "Diagramm", "Vertical Position",unten
SCROLLBAR SET "Diagramm", "Horizontal Range", 0, BreiteView+130-685
SCROLLBAR SET "Diagramm", "Horizontal Position", 0
view 0,0 to BreiteView+130,unten+15, "test", "test1"
draw set "bgcolor", 220,222,0, "test"
draw set "Zurich,Bold,10", "test"
view 50,60 to BreiteView+90,unten, "DrawView", "test"
draw set "highcolor", 0,0,0, "DrawView"
draw set "bgcolor", 255,255,255, "DrawView"
Teilungslinien_links()
Raster()
if (DiagrammTyp=1) then
	linien()
	elseif (DiagrammTyp=2) then
	Balken()
fi
Waagerechte_linie()
Teilungslinien_unten()
Teilungsbeschriftung_unten()
Teilungsbeschriftung_links()
Gesamtanzahl_auf_den_Balken()
Ueberschrift()
sub Waagerechte_linie()
	DRAW LINE 10,unten-70 TO BreiteView+40,unten-70, "DrawView"
end sub
sub Teilungslinien_unten()
	for i = 0 to BreiteView step abstand
		draw line i+abstand,unten-70 to abstand+i,unten-60, "DrawView"
	next i
	draw set "highcolor", 0,0,0, "DrawView"
end sub
sub Raster()
	for i1 = 0 to maximum+10 step 10
		draw set "highcolor", 225,225,225, "DrawView"
		draw line 11,unten-80-i1 to BreiteView+40,unten-80-i1, "DrawView"
	next i1
	draw set "highcolor", 0,0,0, "DrawView"
end sub
sub Teilungsbeschriftung_unten()
	for h = 0 to BreiteView-20 step abstand
		if (h=0) then
			minusx=0
			elseif(h>0 and h<100)
			minusx=2
			elseif(h>99) then
			minusx=4
		fi
		draw text startpunkt+58+h-minusx, unten+10, str$(j), "test"
		j=j+10
	next h
end sub
sub Teilungslinien_links()
	DRAW LINE 10,unten-70 TO 10,unten-90-maximum, "DrawView"
	for l = 0 to maximum+20 step 10
		draw set "highcolor", 0,0,0, "DrawView"
		draw line 0,unten-70-l to 10,unten-70-l, "DrawView"
	next l
	draw set "highcolor", 0,0,0, "DrawView"
end sub
sub Teilungsbeschriftung_links()
	for m = 0 to maximum+20 step 10
		if (m=0) then
			draw text 20, unten-6-m, "      "+str$(m), "test"
			elseif (m>0 and m<100) then
			draw text 20, unten-6-m, "    "+str$(m), "test"
			elseif (m>90 and m<1000) then
			draw text 20, unten-6-m, "  "+str$(m), "test"
			elseif (m>990) then
			draw text 20, unten-6-m, str$(m), "test"
		fi
	next m
end sub
sub linien()
	ix=abstand
	for g=0 to groesseArray-1
		y2=unten-70-alter(g)
		y3=unten-70-alter(g+1)
		draw line ix, y2 to ix+abstand, y3, "DrawView"
		ix=ix+abstand
	next g
	draw set "highcolor", 0,0,0, "DrawView"
end sub
sub Balken()
	ix=AbstandLinks
	for g=0 to groesseArray step 1
		y2=unten-70-alter(g)
		draw set "highcolor", 255,0,255, "DrawView"
		draw set 0, "HighSolidFill"
		draw rect ix+10-7.5, y2 to ix+10+7.5, unten-70, "DrawView"
		ix=ix+abstand
	next g
	draw set "highcolor", 0,0,0, "DrawView"
end sub
sub Gesamtanzahl_auf_den_Balken()
	for n = 0 to groesseArray
		draw set "Zurich,Bold,8", "DrawView"
		if (alter(n)=0) then
		else
			draw text abstand2+f, unten-70-alter(n)-10, str$(alter(n)), "DrawView"
		fi
		f=f+abstand
	next n
	draw set "Zurich,Bold,10", "test"
end sub
sub Ueberschrift()
	ue_laenge=len(ueberschrift$)
	draw set "Zurich,Bold,20", "test"
	draw text ((BreiteView+130)/2), 35, ueberschrift$, "test"
end sub
zeitspannen()
sub zeitspannen()
	wert1$="10.03.1926"
	wert2$="01.01.2027"
	dim teil_datum$(1)
	dim teil_datum2$(1)
	for rr=1 to 3
		zn=split(wert1$, teil_datum$(), ".")
		nz=split(wert2$, teil_datum2$(), ".")
	next rr
	print teil_datum$(1)
	print teil_datum$(2)
	print teil_datum$(3)
	wert3=val(teil_datum$(3))
	wert4=val(teil_datum2$(3))
	wert5=wert4-wert3
	print wert5
end sub
while(not instr(msg$,"NextButton"))
	msg$ = message$
	if(instr(msg$, "Quit")) then
		window close "test"
		end
	fi
	sleep 0.1
wend
window close "MainView"