∟Group Statement

This section describes what is a group statement in H language.

A group statement is a statement that has multiple sub-statements grouped together to be used as a single statement. A group statement has the following syntax:

(
   statement; 
   ...;
);

If you want to put multiple statements as a single sub-statement in a conditional $if, $elseif or $else statement, you need to use a group statement with the following syntax:

$if condition, (
   statement; 
   ...;
);
$elseif condition, (
   statement; 
   ...;
);
...
$else, (
   statement; 
   ...;
);

Here are example of group statements:

$if price > 1000.00, (
   write("Too expensive for me!");
   ...
);
$elseif price < 100.00, (
   write("I want to buy it!");
   ...
);
$else, (
   write("I will think about it!");
   ...
);

Design options:

1. Use round brackets to specify a group statement:

$if condition, (
   statement; 
   ...;
);

2. Use curly brackets to specify a group statement.

$if condition, {
   statement; 
   ...;
};

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

 Variables

 Expressions

►Statements

 What Is an Statement

 Expression Statement

 Assignment Statement

 Conditional "if" Statement

 Conditional "elseif" Statement

 Conditional "else" Statement

►Group Statement

 "while" Loop Statement

 "for" Loop Statement

 Loop "break" Statement

 Loop "next" Statement

 "switch" Statement - Not Supported

 "do...while" Statement - Not Supported

 "boolean" Data Type

 "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