< Rexx Programming < How to Rexx

The backslash character (\) is a logical operator for a Boolean value. It represents negation. Many other programming languages use either an exclamation mark or the word "not" for the same purpose. It precedes a value of 0 or 1 to produce the other value.

/* Boolean values are 0 and 1 */
false = 0
true = 1
/* Backslash means "not" */
say \ false   /* same as: say true */
say \ true    /* same as: say false */

The backslash can also be combined with loose and strict equality to produce "not equal" operators.

/* Loose unequal says false (0) */
say 'ok ' \=  'ok'
/* Strict unequal says true (1) */
say 'ok ' \== 'ok'

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.