5 scnclr 6 cn=0 10 print "laser database program - by devil master" 15 pen 1,2 20 print "---------------------------------------------------*" 21 pen 1,1 22 print " " 23 print "available options:" 24 print " " 25 print "1 - write a new entry into the database" 26 print "2 - read an existing entry from the database" 27 print "3 - delete the database" 28 print " " 29 input "enter your choice: ",ch 30 if ch=1 then goto 35 31 if ch=2 then goto 120 32 if ch=3 then goto 250 33 input "the choice value must be either 1, 2 or 3 - please enter it correctly: ",ch 34 goto 30 35 print " " 36 cn=cn+1 37 if cn=3 then cn=0:scnclr 40 input "name of manufacturer: ",n$ 50 input "wavelength (nanometers): ",l 60 input "power (milliwatts): ",p 61 input "is the beam completely enclosed? (y/n) ",e$ 62 d$="n" 63 if e$<>"y" then input "does the beam either diverge highly or have a large diameter? (y/n) ",d$ 64 if p<1 then cl$="2" 65 if p<5 then cl$="3r" 66 if p<500 then cl$="3b" 67 if p>=500 then cl$="4" 68 if e$="y" then cl$="1" 69 if d$="y" then cl$="2m" 70 append#1,"laserdatabasec65.txt" 80 print#1,n$,l,p,cl$ 90 dclose 100 input "do you want to add another laser to the database? (y/n) ",q$ 110 if q$="y" then goto 35 else goto 1000 120 print " " 121 cn=cn+1 122 if cn=3 then cn=0:scnclr 130 dopen#1,"laserdatabasec65.txt" 140 input "enter the number of the database entry you want to read: ",en 150 for i=1 to en 160 input#1,n$,l,p,cl$ 170 next i 180 print "manufacturer: ";n$ 190 print "wavelength: ";l;" nanometers" 200 print "power: ";p;" milliwatts" 210 print "class: ";cl$ 220 dclose 230 input "do you want to read another database entry? (y/n) ",q$ 240 if q$="y" then goto 120 else goto 1000 250 print " " 260 print "*** w a r n i n g ***" 270 print " " 280 print "if you delete the database, you will not be able to get it back" 290 input "are you sure you want to delete it? (y/n) ",q$ 300 if q$="y" then delete "laserdatabasec65.txt" : print "database deleted - have a nice day": else goto 1000 1000 end