;@modern ; Comparisons, IF and CASE as values, and casts PROC Main() CHAR ARRAY text="one, two, three, four" BYTE a, b, bigger, commas, i CHAR grade CARD sum a=7 b=12 bigger=IF a>b THEN a ELSE b FI ; IF as a value Print("The bigger one: ") PrintBE(bigger) commas=0 FOR i=1 TO text(0) DO commas==+(text(i)=',) ; a comparison is 1 or 0 OD Print("Commas in the text: ") PrintBE(commas) grade=CASE b OF ; CASE as a value WHEN 0 TO 4 THEN 'C WHEN 5 TO 9 THEN 'B ELSE 'A ESAC Print("Grade: ") Put(grade) PutE() a=200 b=100 sum=a+b ; BYTE + BYTE overflows Print("200 + 100 as BYTE: ") PrintCE(sum) sum=CARD(a)+b ; the cast makes it a CARD sum Print("200 + 100 with CARD(a): ") PrintCE(sum) RETURN