A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/TypeCobolTeam/TypeCobol/wiki/TypeCobolTypeBool below:

TypeCobolTypeBool · TypeCobolTeam/TypeCobol Wiki · GitHub

Bool is an intrinsic type of TypeCobol . A bool is limited to two values (TRUE and FALSE); this is not possible with current COBOL 85 syntax. Format :

Main usages are:

SET Identifier to TRUE
Set Identifier to false
if identifier
if not identifier
when identifier

As content of a boolean should be restricted to values ‘TRUE’ and ‘FALSE’ , TypeCobol parser must include specifics controls for Bool type :

You can set a default value for bool just like you do in Cobol 85:

01 var1 TYPE Bool value true.
01 var2 TYPE Bool value false.

By default, the value is false.

In Cobol 85, bool is translated to:

01 Identifier-value PIC X value low-value.
88 Identifier value ‘T’.
88 Identifier-false value 'F' X'00' thru 'S'
                              'U' thru X'FF'.
SET Identifier to TRUE	remains the same in COBOL
SET Identifier to FALSE	will be translated asSET Identifier-false’ to TRUE

Note that in Cobol 2002, you can use "set to false", so type bool is translated to:

01               pic X value low-value.
  88 Identifier        value 'T' false 'F'.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4