What Is a Variable

This section describes what is a variable in H language.

A variable is a symbolic name that refers to a specific data object stored somewhere in the computer memory at any given moment.

The lifecycle of a variable can be managed by the following program execution events:

1. Assigning a data object to a new variable:

x = 1; # x is defined as a new variable, referring to data object "1"

2. Assigning a different data object to an old variable:

x = 1; 
x = "Hello!"; # x is referring to data object "Hello!" now.

3. Updating value of the data object referenced by an old variable.

x = 1; 
x = "Hello!"; 
x[5] = "?"; # x is referring to data object "Hello?" now

4. Removing the reference of an old variable.

x = 1; 
x = "Hello!"; 
x[5] = "?"; 
x = $null; # x is referring to nowhere now

4. Deleting an old variable from the execution environment.

x = 1; 
x = "Hello!"; 
x[5] = "?"; 
x = $null; 
$delete x; # x is no longer available

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

Variables

What Is a Variable

 Variable Names

 Variable Types Are Dynamic

 Expressions

 Statements

 "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