From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9122cfe7284630ab,start X-Google-Attributes: gid103376,public From: eranshap@netvision.net.il Subject: A question about v'range...? Date: 1997/01/08 Message-ID: #1/1 X-Deja-AN: 208504995 organization: NetVision LTD. content-type: TEXT/PLAIN; charset=US-ASCII mime-version: 1.0 newsgroups: comp.lang.ada Date: 1997-01-08T00:00:00+00:00 List-Id: Hi All, I have the following program: --BEGINNING OF PROGRAM with Ada.Text_IO; procedure taskmain is NUM_OF_ELEMENTS : constant Integer := 100; NUM_OF_TASKS : constant Integer := 10; type array_type is array (Integer range <>) of Positive; procedure Find_primes (vector : in array_type; num : in Positive) is task Manage; task body Manage is ind : Positive; begin for k in vector'range loop ind := k mod num; Ada.Text_IO.Put_line (positive'image (k)); Ada.Text_IO.Put_line (integer'image (vector'first)); Ada.Text_IO.Put_line (integer'image (vector'last)); end loop; end Manage; begin -- of Procedure find_primes null; end Find_primes; vect : array_type(1..NUM_OF_ELEMENTS); begin -- of procedure taskmain for inc in vect'range loop vect(inc) := inc; end loop; Find_primes (vect, NUM_OF_TASKS); end; --END OF PROGRAM And I get this output: 1 1 100 2 1 100 3 1 100 4 1 100 5 1 100 6 1 100 7 1 100 8 1 100 9 1 100 This means that vector'range inside the task Manage is 1..9, while vector'first is 1, and vector'last is 100, as printed. I can also add, that when I did the same printing with the taskmain procedure, it computed it correctly, i.e. vect'range is 1..100. Why does this happen? What can I do to correct it?