home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / CONV.OPL < prev    next >
Text File  |  1993-03-17  |  2KB  |  54 lines

  1. REM ==========================
  2. REM psion/series3 #2691, from csljohns, 1245 chars, Sep 29 22:22 92
  3. REM This is a comment to message 2660.
  4. REM There are comments to this message.
  5. REM --------------------------
  6. REM For what it's worth, frequently used conversions can be LOADed
  7. REM into the calculator as a little compiled OPL (OPO) program:
  8. REM e.g...
  9. PROC cm2in:(cm)          REM  Centimeters to inches
  10. RETURN cm/2.54
  11. ENDP
  12. PROC in2cm:(in)          REM  viceversa
  13. RETURN in*2.54
  14. ENDP
  15. PROC cen2far:(ce)        REM  centigrade to farenheit
  16. RETURN (ce*9/5)+32
  17. ENDP
  18. PROC far2cen:(fa)        REM  viceversa
  19. RETURN (fa-32)*5/9
  20. ENDP
  21. PROC lb2kg:(lb)          REM  pounds to kg
  22. RETURN lb*0.454
  23. ENDP
  24. PROC kg2lb:(kg)          REM  viceversa
  25. RETURN kg*2.205
  26. ENDP
  27. PROC ga2li:(ga)          REM  gall to litres
  28. RETURN ga*4546
  29. ENDP
  30. PROC li2ga:(li)          REM  litres to gall
  31. RETURN li*0.220
  32. ENDP
  33. PROC h2m:(h,m)           REM  Hours to mins (! see below)
  34. RETURN 60*h+m
  35. ENDP
  36. PROC m2h:(m)             REM  Mins to hours (! see below)
  37. LOCAL h,i
  38. h=INT(m/60)
  39. i=INT(m-h*60)
  40. RETURN (h*100+i)/100
  41. ENDP
  42. PROC et:(onh,onm,offh,offm)   REM  Hours+mins between two times
  43. LOCAL ton,toff                REM  useful when programming a
  44. ton = h2m:(onh,onm)           REM  video!!
  45. toff = h2m:(offh,offm)        REM
  46. RETURN m2h:(toff-ton)
  47. ENDP
  48.  
  49. REM Use:  At the calculator, load CALC.OPL then use the routines
  50. REM byt typing (e.g.  cm->ins)     cm2in:(56+2-45)
  51. REM converts 13 cm to inches etc...
  52. REM
  53. REM Carl Littlejohns
  54. REM