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 Fortran 90 Programmer's Reference: HP Fortran 90 Programmer's Reference > Chapter 10 HP Fortran 90 statements

AUTOMATIC (extension)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Makes procedure variables and arrays automatic.

Syntax

AUTOMATIC var-name-list
var-name-list

is a comma-separated list of names of variables and arrays to be declared as automatic. Array names may be followed by an optional explicit-shape-spec.

Description

The AUTOMATIC statement is provided as an HP extension.

If a variable or array declared within a procedure is declared as automatic, then there is one copy of it for each invocation of the procedure. Space is allocated on entry to the procedure and deallocated on exit. This is also the default for variables that do not have the SAVE or STATIC attribute, unless the +save option has been specified.

If it is required to have the same copy of a variable available to each invocation of the routine (for example, to keep a record of the depth of recursion), then the variable should have the SAVE attribute.

Note the following:

  • The AUTOMATIC statement may only be used within a procedure.

  • Local variables are AUTOMATIC by default.

  • Arguments and function values are AUTOMATIC.

  • Automatic variables may not appear in EQUIVALENCE, DATA or SAVE statements.

  • The AUTOMATIC attribute is not the same as automatic arrays and automatic character strings.

Examples

AUTOMATIC r, s, u, v, w(10)

Related statements

SAVE and STATIC

Related concepts

For information about automatic and static variables, refer to the HP Fortran 90 Programmer's Guide.

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