0 Members and 1 Guest are viewing this topic.
All right, I finished the translation and updated the graphical and rounding routines at the same time.The updated version has been posted, and it's at the same place on TI-Planet :http://tiplanet.org/index.php?mod=archives&ac=voir&id=3754
Define LibPub avancement_en()=Prgm:Local i,tmp1:DelVar lnoms:DelVar lmoles:DelVar lcoeff:DelVar lreste:DelVar reactlim:luasignal:=−1337:nbrreact:=0: nbrprod:=0:While nbrreact=0: Request "How many reagants ? ",nbrreact:EndWhile:For i,1,nbrreact: RequestStr "Symbol of reagent n°"&string(i)&" ? ",lnoms[i]: Request "Coefficient of reagent n°"&string(i)&" ? ",lcoeff[i]: Request "How many moles of reagant n°"&string(i)&" ? ",lmoles[i]:EndFor:Disp "---------":While nbrprod=0: Request "How many product(s) ? ",nbrprod:EndWhile:For i,nbrreact+1,nbrreact+nbrprod: RequestStr "Symbol of product n°"&string(i-nbrreact)&" ? ",lnoms[i]: Request "Coefficient of product n°"&string(i-nbrreact)&" ? ",lcoeff[i]: Request "How many moles of product n°"&string(i-nbrreact)&" ? ",lmoles[i]:EndFor:Disp "---------":reactlim:=0:xmax:=9000:For i,1,nbrreact: tmp1:=((lmoles[i])/(lcoeff[i])): If tmp1<xmax Then: reactlim:=reactlim+1: xmax:=tmp1: Else: If tmp1=xmax Then: xmax:=−1: EndIf: EndIf:EndFor:If xmax>0 Then: Disp "Limitant reagent : n°",reactlim: Disp "Xmax = ",approx(xmax)," mol.":Else: xmax:=((lmoles[1])/(lcoeff[1])): Disp "Stoechiometrical proportions.": Disp "Xmax = ",approx(xmax)," mol.":EndIf:For i,1,nbrreact: lreste[i]:=approx(lmoles[i]-xmax): If i≠reactlim Then: Disp "There is/are ",approx(lmoles[i]-xmax)," moles of ",lnoms[i]," left.": Else: lreste[i]:=0: Disp "There is no more ",lnoms[i]: EndIf:EndFor:For i,nbrreact+1,nbrreact+nbrprod: lreste[i]:=approx(lmoles[i]+lcoeff[i]*xmax): Disp lreste[i]," moles of ",lnoms[i]," has/have been made.":EndFor:xmax:=string(approx(xmax)):luasignal:=42+rand():Disp "---------":Disp "The summary table is in the following tab.":EndPrgm