Created On: 10 March 2011
Problem:
In C# one can use the following OR operator to do bitwise operations on flag fields.
TextFormatFlags sf = TextFormatFlags.VerticalCenter |
TextFormatFlags.HorizontalCenter |
TextFormatFlags.NoFullWidthCharacterBreak;
How does one do a similar thing in Visual COBOL?
TextFormatFlags sf = TextFormatFlags.VerticalCenter |
TextFormatFlags.HorizontalCenter |
TextFormatFlags.NoFullWidthCharacterBreak;
How does one do a similar thing in Visual COBOL?
Resolution:
The b-or operator can be used to achieve this effect as follows:
In C#
TextFormatFlags sf = TextFormatFlags.VerticalCenter |
TextFormatFlags.HorizontalCenter |
TextFormatFlags.NoFullWidthCharacterBreak;
Visual COBOL:
01 sf type TextFormatFlags.
...
set sf to type TextFormatFlags::VerticalCenter b-or
type TextFormatFlags::HorizontalCenter b-or
type TextFormatFlags::NoFullWidthCharacterBreak
Visual COBOL also supports b-and, b-xor and b-not operators.
In C#
TextFormatFlags sf = TextFormatFlags.VerticalCenter |
TextFormatFlags.HorizontalCenter |
TextFormatFlags.NoFullWidthCharacterBreak;
Visual COBOL:
01 sf type TextFormatFlags.
...
set sf to type TextFormatFlags::VerticalCenter b-or
type TextFormatFlags::HorizontalCenter b-or
type TextFormatFlags::NoFullWidthCharacterBreak
Visual COBOL also supports b-and, b-xor and b-not operators.