PROC konv: LOCAL vs$(35),typ$(201),typ%,c%,dPos% GLOBAL enh$(201),enh%,enhtot%,indata GLOBAL d% vs$="Konv version 3.a1 940922" print vs$ pause 66 open "\dat\konv.dbf",a,a$,e1$,e2$,e3$,e4$,e5$,e6$,e7$,e8$ typ$="Programinfo!" do typ$=typ$+","+a.a$ next until eof typ%=2:d%=5 strt:: cls dINIT "Konvertering av enheter" dCHOICE typ%,"Typ",typ$ if DIALOG=0:return :endif if typ%=1 dINIT dTEXT "",vs$,$302 dTEXT "","Copyright Michael Cronsten",$2 DIALOG :typ%=2:goto strt:: endif position typ%-1 enh$="":enhtot%=0 do if pick$:(1,enhtot%+1)="":break :endif enhtot%=enhtot%+1 enh$=enh$+","+pick$:(1,enhtot%) until enhtot%=8 enh$=mid$(enh$,2,200) enh%=1:dPos%=0 ct:: dINIT "Konvertering av "+a.a$ dPOSITION dPos%,dPos% dFLOAT indata,"Inmatat v„rde",-9.99999999999e99,9.99999999999e99 dCHOICE enh%,"Konvertera fr†n",enh$ dCHOICE d%,"Decimaler","inga,3,6,9,samtliga" if dialog=0:goto strt:: :endif dPos%=1 cls print indata,pick$:(1,enh%),"=" print rept$("-",60); if loc(a.a$,"Temp") if enh%=1 :rem Celsius ca:(273.15+indata):print "Kelvin" ca:(indata*9/5+32):print "Fahrenheit" elseif enh%=2 :rem Kelvin ca:(-273.15+indata):print "Celsius" ca:((-273.15+indata)*9/5+32):print "Fahrenheit" elseif enh%=3 :rem Fahrenheit ca:((indata-32)*5/9):print "Celsius" ca:(273.15+(indata-32)*5/9):print "Kelvin" endif else c%=0 do c%=c%+1 if enh%<>c% ca:(indata*eval(pick$:(0,c%))/eval(pick$:(0,enh%))) print pick$:(1,c%) endif until c%=enhtot% endif get goto ct:: endp proc pick$:(x%,y%) local i%,y$(200) if y%=1 y$=a.e1$ elseif y%=2 y$=a.e2$ elseif y%=3 y$=a.e3$ elseif y%=4 y$=a.e4$ elseif y%=5 y$=a.e5$ elseif y%=6 y$=a.e6$ elseif y%=7 y$=a.e7$ elseif y%=8 y$=a.e8$ endif i%=loc(y$," ") if y$="" return "" elseif x%=0 return left$(y$,i%-1) else return mid$(y$,i%+1,200) endif endp proc ca:(i) if d%=5:print i, else print fix$(i,(d%-1)*3,50), endif endp