Temperature conversion/REXX: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: changed/added comments and whitespace, changed indentations, split compound lines.)
m (→‎{{header|REXX}}: split a comment from the statement.)
Line 15: Line 15:
parse upper var z z ' TO ' ! . /*separate the TO option from number.*/
parse upper var z z ' TO ' ! . /*separate the TO option from number.*/
parse var z z 'NOT' not . , noS noE /*separate NOT option from number. */
parse var z z 'NOT' not . , noS noE /*separate NOT option from number. */

/* *xxx ◄───don't show scales that end in xxx */
/* xxx* ◄─── " " " " begin with xxx */
/* *xxx ◄───don't show scales that end in xxx */
if not\=='' then do egin with xxx */
/* xxx* ◄─── " " " " begin with xxx */
if not\=='' then do
if left(not, 1)=='*' then noE=substr(not, 2)
if left(not, 1)=='*' then noE=substr(not, 2)
if right(not, 1)=='*' then noS=left(not, length(not)-1)
if right(not, 1)=='*' then noS=left(not, length(not)-1)
Line 47: Line 48:
call scaleName u /*allow alternate temp. scale spellings*/
call scaleName u /*allow alternate temp. scale spellings*/


select /*convert N ──► °F temperatures. */
/*convert N ──► °F temperatures. */
select
when sn=='AMONTON' then F= n * 8.37209 - 399.163
when sn=='AMONTON' then F= n * 8.37209 - 399.163
when sn=='BARNSDORF' then F= n * 6.85714 + 6.85714
when sn=='BARNSDORF' then F= n * 6.85714 + 6.85714