Temperature conversion: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: simplified uppercasing of some none-Latin characters, added whitespace. -- ~~~~) |
m (→{{header|REXX}}: added support for better error reporting. -- ~~~~) |
||
Line 258: | Line 258: | ||
if z=='' then call serr 'no arguments were specified.' |
if z=='' then call serr 'no arguments were specified.' |
||
_=verify(z, '+-.0123456789') /*a list of valid number thingys.*/ |
_=verify(z, '+-.0123456789') /*a list of valid number thingys.*/ |
||
n=z |
|||
if _\==0 then do |
if _\==0 then do |
||
if _==1 then call serr 'illegal temperature:' |
if _==1 then call serr 'illegal temperature:' z |
||
n=left(z,_-1) |
n=left(z, _-1) /*pick off the number (hopefully)*/ |
||
u=strip(substr(z,_)) |
u=strip(substr(z, _)) /*pick off the temperature unit. */ |
||
end |
end |
||
else u='k' /*assume Kelvin as per task req.*/ |
else u='k' /*assume Kelvin as per task req.*/ |