RosettaCodeData/Task/Temperature-conversion/Visual-FoxPro/temperature-conversion.fvp

26 lines
461 B
Plaintext

#DEFINE ABSZC 273.16
#DEFINE ABSZF 459.67
LOCAL k As Double, c As Double, f As Double, r As Double, n As Integer, ;
cf As String
n = SET("Decimals")
cf = SET("Fixed")
SET DECIMALS TO 2
SET FIXED ON
CLEAR
DO WHILE .T.
k = VAL(INPUTBOX("Degrees Kelvin:", "Temperature"))
IF k <= 0
EXIT
ENDIF
? "K:", k
c = k - ABSZC
? "C:", c
f = 1.8*c + 32
? "F:", f
r = f + ABSZF
? "R:", r
?
ENDDO
SET FIXED &cf
SET DECIMALS TO n