Character codes: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 495:
whether it be hexadecimal, binary (bits), or decimal codes.
<lang rexx>
yyy='c' /*assign a lowercase c to YYY.*/
yyy='34'x /*assign hexadecimal 34 to YYY.*/
yyy=x2c(34) /* (same as above) */
yyy='00110100'b /* (same as above) */
yyy=d2c(97) /*assign decimal code 97 to YYY.*/
 
say y /*displays the value of YYY. */
say c2x(yyy) /*displays the value of YYY in hexadecimal. */
say c2d(yyy) /*displays the value of YYY in decimal. */
say x2b(c2x(yyy)) /*displays the value of YYY in binary (bit string). */
</lang>