forked from neopragma/t-rexx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.rexx
44 lines (38 loc) · 991 Bytes
/
calc.rexx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* a rexx application to demonstrate the unit test framework */
calc:
parse arg val1, op, val2
if op == '+' then
calcResult = val1 + val2
if op == '-' then
calcResult = val1 - val2
if op == '*' then
calcResult = val1 * val2
if op == '/' then
calcResult = val1 / val2
call sayCalcResult2 calcResult
return calcResult
calcWithoutAnyReturn:
parse arg val1, op, val2
if op == '+' then
calcResult = val1 + val2
if op == '-' then
calcResult = val1 - val2
if op == '*' then
calcResult = val1 * val2
if op == '/' then
calcResult = val1 / val2
call sayCalcResult calcResult
rc = sayCalcResultWithReturn(calcResult)
return
sayCalcResult: procedure
arg lineToPrint
say 'sayCalcResult printing:' lineToPrint
return
sayCalcResult2: procedure
arg lineToPrint
say 'sayCalcResult2 printing:' lineToPrint
return
sayCalcResultWithReturn: procedure
arg lineToPrint
say 'sayCalcResultWithReturn printing:' lineToPrint
return 8