Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Negative Subscript for FORTRAN

IP.com Disclosure Number: IPCOM000074077D
Original Publication Date: 1971-Mar-01
Included in the Prior Art Database: 2005-Feb-23
Document File: 1 page(s) / 11K

Publishing Venue

IBM

Related People

Weinert, GS: AUTHOR

Abstract

This method allows the direct use of zero and negative subscripts (and DO LOOP indexes) in compilers, ordinarily thought of as not being capable of properly accepting such values, such as those for the IBM 1130. 1800 and IBM System 360 E, G and PS.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

Negative Subscript for FORTRAN

This method allows the direct use of zero and negative subscripts (and DO LOOP indexes) in compilers, ordinarily thought of as not being capable of properly accepting such values, such as those for the IBM 1130. 1800 and IBM System 360 E, G and PS.

Compilers for most current releases of FORTRAN will not normally accept negative or zero subscripts. Because these compilers calculate subscripts by an algebraic function which is mathematically consistent for zero and negative values and the compilers do not error check for illegal subscripts, both zero and negative subscripts may be utilized by the following method.

The EQUIVALENCE statement may be used by a programmer to overlap two arrays in storage, such that the zero and negative portions of a second array are within the storage allocated for a first array and not in some unknown storage position. Without the proper overlay, other valid information normally stored in adjacent storage would be wiped out when zero or negative subscripts are used. A variable containing the negative value of the subscript should be used rather than actual numerical values to avoid compiler diagnostics.

1