' b$ = Datensatz ' ed = Speichern? ' nr = Satznummer ' dv = l auf 100 km ' kg = gefahrene Kilometer ' kv = l im Verhltnis zu km ' vma = max. Verbrauch ' vmi = minimaler Verbrauch ' x,y,z = temporre Variablen display 0 randomize on error goto 1000 dim b$(75) nr=-1 ed=0 10 open "I",1,"c:\benzin.dat" while not eof(1) nr=nr+1 input# 1,b$(nr) wend close# 1 100 repeat cls locate 1,1,0:print "Benzin - Was verbraucht mein Auto?" locate 2,1:print string$(40,196) locate 3,1:print "1. Anzeigen der bisherigen Eintrge" locate 4,1:print "2. Statistik mit Verbrauchsgrafik" locate 5,1:print "3. Eingeben eines Eintrages" locate 6,1:print "4. Bedienung dieser Software" locate 7,1:print string$(40,196) locate 8,1:print "(c) 2000 MONSTERVISION Software V1.0" i$="" while i$="" i$=inkey$ wend on val(i$) goto 1100,1200,1300,1400 until i$=chr$(27) cls while ed=1 locate 1,1,0:print "Speichere Satz" ed=0 open "O",1,"c:\benzin.dat" for a=0 to nr write# 1,b$(a) locate 1,16:print a+1 next a wend locate 1,1:print "Benzin - Was verbraucht mein Auto?" locate 2,1:print "Version 1.0 vom 24.02.2000" locate 3,1:print "Dieses Programm ist Freeware und darf" locate 4,1:print "kostenlos kopiert werden." locate 5,1:print "Autor: Volker Niemeyer" locate 6,1:print "eMail: bazonga-press@gmx.net" locate 7,1,1:print "Homepage http://www.bazonga-press.de" display 1 end 1000 open "O",1,"c:\benzin.dat" write# 1,"01.02.20008.14 390.4 " write# 1,"19.02.20007.11 391.4 " ' for a=0 to 75 ' x=int(700*rnd)+100 ' y=int(7000*rnd)+1000 ' if a<10 then write# 1,"0"+str$(a)+".02.2000"+str$(x+.23)+str$(y+.5) else write# 1,str$(a)+".02.2000"+str$(x+.23)+str$(y+.5) 'next a close# 1 goto 10 1100 z=0 repeat cls locate 1,1,0:print "Taste Datum Verbrauch Kilometer " x=2 y=z while y"0" and x$<"8" and nr>=z+val(x$)-1 locate 1,1,0:print "Eintrag Nr. "+x$+" wirklich lschen (j)? " y$="" while y$="" y$=inkey$ wend while y$="j" y$="" for a=z+val(x$)-1 to nr-1 b$(a)=b$(a+1) next a nr=nr-1 ed=1 if nr=-1 then gosub 1500 wend x$="" wend until x$=chr$(27) goto 100 1200 if nr=-1 then goto 100 cls dv=0 kg=0 kv=0 vma=0 vmi=999.99 locate 1,1,0:print "Berechne..." for x=0 to nr y=val(mid$(b$(x),11,6)) dv=dv+y if y>vma then vma=y if yvmi and nr>0 then gosub 1600 else print "Nicht genug Daten fr Grafik!" wend x$="" while x$="" x$=inkey$ wend s1=s1+1 while s1=3 s1=1 screen 7 wend until x$=chr$(27) goto 100 1300 if nr>75 then goto 100 cls w=0 locate 7,1,0:print string$(40,196) locate 8,1,1:print "Bitte das Tankdatum eingeben" while w=0 f=0 locate 1,1:print string$(40,32) locate 1,1:input "Datum (tt.mm.jjjj): ",d$ while left$(d$,2)<"01" or left$(d$,2)>"31" and f=0 locate 8,1:print string$(40,32) locate 8,1:print "Tag mu zwischen 1 und 31 sein." f=1 wend while mid$(d$,4,2)<"01" or mid$(d$,4,2)>"12" and f=0 locate 8,1:print string$(40,32) locate 8,1:print "Monat mu zwischen 1 und 12 sein." f=1 wend while mid$(d$,7,4)<"1900" or mid$(d$,7,4)>"2100" and f=0 locate 8,1:print string$(40,32) locate 8,1:print "Jahr mu zwischen 1900 und 2100 sein." f=1 wend if f=0 then w=1 wend locate 8,1:print "Bitte Gesamtmenge in Liter eingeben " w=0 while w=0 f=0 locate 2,1:print string$(40,32) locate 2,1:input "Gesamtmenge l: ",l while l<0.01 or l>999.99 locate 8,1:print string$(40,32) locate 8,1:print "Nur Eingaben von 0.01 bis 999.99!" f=1 l=1 wend if f=0 then w=1 wend locate 8,1:print "Die Gesamtstrecke in Kilometer eingeben " w=0 while w=0 f=0 locate 3,1:print string$(40,32) locate 3,1:input "Gesamtstrecke km: ",k while k<0.1 or k>9999.9 locate 8,1:print string$(40,32) locate 8,1:print "Nur Eingaben von 0.1 bis 9999.9!" f=1 k=1 wend if f=0 then w=1 wend locate 8,1,0:print string$(40,32) locate 8,1,0:print "Eingaben speichern (j)?" j$="" while j$="" j$=inkey$ wend while j$="j" v=int(l/k*10000)/100 nr=nr+1 locate 5,1,0:print "Verbrauch 100km/l: ";str$(v) b$(nr)=d$ b$(nr)=b$(nr)+str$(v)+string$(6-len(str$(v)),32) b$(nr)=b$(nr)+str$(k)+string$(6-len(str$(k)),32) open "A",1,"c:\benzin.dat" write# 1,b$(nr) close# 1 j$="" locate 8,1,0:print string$(40,32) locate 8,1,0:print "Beenden mit Taste" wait wend goto 100 1400 cls s=1 repeat y=s while y=1 cls y=0 locate 1,1,0:print ">>> Hauptmenue" locate 2,1:print "Taste 1-4: Funktionen laut Beschreibung" locate 3,1:print "Taste ESC: Programm beenden" locate 4,1:print ">>> Anzeigemodus" locate 5,1:print "Pfeil hoch/runter: blttern" locate 6,1:print "Taste a: Zum Anfang blttern" locate 7,1:print "Taste e: Zum Ende blttern" locate 8,1:print "Taste 1-7: Lschen des Eintrages" wend while y=2 cls y=0 locate 1,1,0:print "...Fortsetzung Anzeigemodus" locate 2,1:print "Taste ESC: Zurck zum Hauptmenue" locate 3,1:print ">>> Statistik" locate 4,1:print "Taste: Blttern" locate 5,1:print "Taste ESC: Zurck zum Hauptmenue" locate 6,1:print ">>> Eingabe" locate 7,1:print "Taste CR: zum nchsten Eingabefeld" locate 8,1:print "Taste nach Eingabe: Zum Hauptmenue" wend while y=3 cls y=0 locate 1,1,0:print ">>> Bedienung" locate 2,1:print "Pfeil hoch/runter: blttern" locate 3,1:print "Taste ESC: Zurck zum Hauptmenue" wend x$="" while x$="" x$=inkey$ wend if x$="HH" then s=s-1 if x$="PP" then s=s+1 if s=0 then s=3 if s=4 then s=1 until x$=chr$(27) goto 100 1500 ed=0 kill "c:\benzin.dat" return 1600 cls screen 4 locate 1,1,0:print using "%6.2f";vmi p1=vma-vmi locate 4,1,0:print using "%6.2f";p1/2+vmi locate 8,1,0:print using "%6.2f";vma p2=p1/64 for x=0 to 63 pset(44,x),1 next x for x=39 to 46 pset(x,0),1 pset(x,32),1 pset(x,63),1 next x for x=0 to nr p4=val(mid$(b$(x),11,6)) p4=int((p4-vmi)/p2) y=x*2+50 if p4<32 then p5=1 else p5=2 while p5=1 p5=0 for z=p4 to 32 pset(y,z),1 pset(y+1,z),1 next z wend while p5=2 p5=0 for z=32 to p4 pset(y,z),1 pset(y+1,z),1 next z wend next x return