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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32b8be7d0d9988ed,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-29 10:27:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!ps01-chi1!newsfeeds-atl2!news.webusenet.com!pc01.webusenet.com!e3500-atl2.usenetserver.com.POSTED!not-for-mail From: "gilrain" Newsgroups: comp.lang.ada Subject: "In reverse" in for loop acting weird. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Sun, 29 Sep 2002 13:22:55 EDT Organization: WEBUSENET.com Date: Sun, 29 Sep 2002 12:28:40 -0500 Xref: archiver1.google.com comp.lang.ada:29411 Date: 2002-09-29T12:28:40-05:00 List-Id: Hi all, Okay, my program is working perfectly except for this one minor detail. The result (stored in a string) prints exactly backward. What's baffling me is that it's still backward even when I reverse the process for building the string. Here's the offending code segment: for j in reverse -15..15 loop case integer(abs(coefficients(j))) is when 0 => result(j+16) := '0'; when 1 => result(j+16) := '1'; when 2 => result(j+16) := '2'; when 3 => result(j+16) := '3'; when 4 => result(j+16) := '4'; when 5 => result(j+16) := '5'; when 6 => result(j+16) := '6'; when 7 => result(j+16) := '7'; when 8 => result(j+16) := '8'; when 9 => result(j+16) := '9'; when 10 => result(j+16) := 'A'; when 11 => result(j+16) := 'B'; when 12 => result(j+16) := 'C'; when 13 => result(j+16) := 'D'; when 14 => result(j+16) := 'E'; when 15 => result(j+16) := 'F'; when 16 => result(j+16) := 'G'; when others => result(j+16) := '!'; end case; end loop; result(16) := '.'; Coefficients is an array of long floats which at this point in the program only contains whole numbers. I want coefficients(15) to be the first character in the string, and so on to -15. The above code prints it backwards, but the thing which gets me is that taking out "reverse" doesn't change the program output one bit! Will someone clue me in? Thanks, John Thile