Constructor Function: boolean()

This section describes 'boolean' constructor function boolean().

New "boolean" data object can be created with the "boolean" constructor function, boolean(), which has the following syntax:

boolean(a = $true)

Parameters:
   a - A "boolean" data object. Default is $true.

Return: 
   Returns a new "boolean" data object representing 
   the same value as "a".

Examples of how to use "boolean" constructor function:

boolean(); # create a new data object representing $true

x = boolean(); # assign a new data object representing $true to x

# assign a new data object representing $false to y
y = boolean(1 > 2); 

Design options:

1. Let the constructor return $true if no parameter provided.

2. Make the parameter as required for the constructor.

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

 Variables

 Expressions

 Statements

"boolean" Data Type

 What Is "boolean" Data Type

 "boolean" Literals

Constructor Function: boolean()

 "boolean" "and" Operation

 "boolean" "or" Operation

 "boolean" "xor" Operation

 "boolean" "not" Operation

 "integer" Data Type

 "string" Data Type

 "real" Data Type

 "array" Data Type

 Source Code Packages

 Classes and Objects

 Object Oriented Programming

 Inheritance - Object Attachments

 Encapsulation - Private Members

 References

 Full Version in PDF/ePUB