# Pixel convert.bas draw -1 dim a$(4) a$(1)="Pixels" a$(2)="Inches" form fld 2,30,30,12, "",1 form fld 28,60,30,12, "",1 form fld 110,60,30,12, "",1 form lst 2,90,2,1,a$,1 form btn 117,147,40,12, "Enter",1 draw "Enter Resolution",2,18,1 draw "dpi",35,32 draw "Enter Dimensions",2,48,1 draw "Width",2,62 draw "X",65,62,1 draw "Height",80,62 draw "Units Entered",2,78,1 while 1 x = asc(input$(1)) d=val(s$(0)) w=val(s$(1)) : h=val(s$(2)) u=val(s$(3)) D$="Enter image resolution." W$="Enter image Width." H$="Enter image Height." V$="Input must be a Positive Integer." r$="Result: " b$=" by " i$=" inches." p$=" pixels." if s$(0)="" then ? D$ : wend if s$(1)="" then ? W$ : wend if s$(2)="" then ? H$ : wend if d<0 then ? V$ : wend if w<0 then ? V$ : wend if h<0 then ? V$ : wend if u=1 then goto inches if u=2 then goto pixels inches: w$=w/d : h$=h/d print r$+w$+b$+h$+i$ wend pixels: w$=w*d : h$=h*d print r$+w$+b$+h$+p$ wend end