^MA 1 80 ^PL 66 3 3 ^JU ^CE^SK0-----+++-----+++-+++----+----------- ^SK1Load the following FORTH text file ( name the file UNITCONV ) so as to be able to write any consistent set of unit conversions, and simply key in :- ^CO^SK1 Or: 12.87 FT - IN to display 154.440 in ^SK1Textfile UNITCONV ^CO^SK1 1: VOCABULARY UNITS ^CO^SK0 2: UNITS DEFINITIONS ^CO^SK0 3: DECIMAL 3 FIX ^CO^SK0 4: VARIABLE 'FACTOR ^CO^SK0 5: : >UNIT 2DROP F/ ; ^CO^SK0 6: : >CONVERT F* F. TYPE ; ^CO^SK0 7: : UNIT 'FACTOR @ EXECUTE ; ^CO^SK0 8: : CONVERT ['] >UNIT 'FACTOR ! ; ^CO^SK0 9: : - ['] >CONVERT 'FACTOR ! ; ^CO^SK0 10: : CONV ( F --) UNIT CONVERT QUIT ; ^CO^SK0 11: : CONVERT ^JU^SK2Under UNITS DEFINITIONS, write words as follows to provide any list of consistent units of a particular quantity, ^SK1i.e. length in this example. ^SK1: M 1. " m" CONV ; ^SK0: MM 1000. " mm" CONV ; ^SK0: FT 3.28084 " ft" CONV ; ^SK0: IN 39.3700784 " in" CONV ; ^SK1Etc. ^JU^SK1A base unit ( in this example, metres is selected and, for each unit, the word simply says e.g. 3.28084 feet equals a metre. For all units' tabulated conversion factors ( ready to use in this program ) see BS 350 Part 1. But no list of conversion factors is that easy to use. Rather than use FORTH - Quick and easy, and a natural way of working which you know is right. ^CE^SK1----+--+----------+--+--------+-----+--------+-----+----+--- ^CE^SK0Alan E. Christian, 18 Hambrook Road, Gosport, Hants PO12 3JH ^CE^SK0----+--+----------+--+--------+-----+--------+-----+----+---