some asides on the lowest index for an array


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Bob A on April 12, 2011 at 05:45:34:

In Reply to: Re: Comet 32 Arrays posted by Jeff Cinelli on April 11, 2011 at 07:59:02:

in FORTRAN, the lower bound is given as follows (note that the lower bound is different along the 2 dimensions):

INTEGER jj (0:100, -1:1)

! Lower bounds are specified for jj. (If not given, they default to 1.)

so that if you had yearly sales, you could have Sales (1970:2020) and you could use the actual year as the index.

just a thought, but another way to specify the lower bound is used in APL... to keep it simple, there are only 2 choices so.. at the start of the source, one could code:

ORIG=0
ORIG=1

then all dimensions would be the same...

(it's been over 35 years since I programmed in APL, so I con't remember which was the default, nor what happens when one calls or enters another program file, which may or may not have the same ORIG clause)....

Bob "A"


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]