Load Program Package in Functions

This section describes how to load an H program package file in a function.

You can load an H program package locally into a function definition body. The loaded package scope is then limited to function body.

Example of loading an H program package in a function:

$function showCircleArea(r): {
   $load c $from "circle.h";
   write(c.area(r));
};

showCircleArea(2.0); # print the area of a circle
write(c.pi); # NullPointer error.

Last update: 2017.

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

 Variables

 Expressions

 Statements

 "boolean" Data Type

 "integer" Data Type

 "string" Data Type

 "real" Data Type

 "array" Data Type

Source Code Packages

 What Is Function

 Create H Program Package File

 Load H Program Package File

 Load Program Package Multiple Times

Load Program Package in Functions

 Load Program Package Remotely

 Expose H Program Package File

 Classes and Objects

 Object Oriented Programming

 Inheritance - Object Attachments

 Encapsulation - Private Members

 References

 PDF Printing Version