Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Pascal/HP-UX Programmer's Guide > Chapter 6 Dynamic Variables

Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

A dynamic variable is allocated during program execution. In contrast, a global, module, or local variable is allocated when the block containing its declaration is activated.

Table 6-1 “Dynamic versus Static Variables ” shows the differences between dynamic and static variables.

Table 6-1 Dynamic versus Static Variables

Dynamic Variable

Global or Module Variable

Local Variable

Declared?

No

Yes

Yes

Referenced by

Pointer (which is declared).

Name

Name

Allocated

During execution, with the function new.

Before compilation unit executes.

Upon entering procedure or function that declares it.

Stored on the

Heap

Static area

Stack

Deallocated

During execution, with the procedure dispose or release.

After program has executed.

After exiting the procedure or function that declares it.

 

This chapter explains:

  • Pointer types peculiar to HP Pascal (globalanyptr, anyptr, and localanyptr).

  • HP Pascal procedures new and dispose, which allocate and deallocate dynamic variables.

  • HP Pascal procedures mark and release, which allow an HP Pascal program to deallocate a region of the heap that it no longer needs.

  • Intrinsic procedures p_getheap and p_rtnheap, which allow a program written in any language that runs on the operating system to allocate and deallocate a region of the HP Pascal heap.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.