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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,794c64d1f9164710 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-22 16:36:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-x2.support.nl!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters Date: Fri, 22 Feb 2002 09:11:56 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <20020221130715.12738.00000034@mb-bg.aol.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1014387116 5467 136.170.200.133 (22 Feb 2002 14:11:56 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 22 Feb 2002 14:11:56 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:20274 Date: 2002-02-22T14:11:56+00:00 List-Id: You seem to be missing some fundamental concepts of Ada - and possibly programming in general. Type checking is your problem here and that is something lots of languages do - not just Ada. One type is not interchangeable with another - that's the whole reason for their existence. A String is not identical to a Character so you have assignments and comparisons that are incorrect. You really should spend some time looking at one of the Ada books or tutorials that have been recommended. Barring that, you ought to be making better use of your compiler. It undoubtedly is outputting error messages that will help you figure out what is going on. If you can't figure out what the error messages are telling you, you could post the relavent code snippets here & possibly get a more detailed explanation. You don't say what compiler you are using, but if you are using Gnat, try the following command line options: gnatmake -gnatvl That will give you verbose error messages and a program listing that may be helpful when posting questions. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ wrote in message news:dcb99faa.0202211448.537be1d4@posting.google.com... > unversedangel@aol.com (Unversed Angel) wrote in message news:<20020221130715.12738.00000034@mb-bg.aol.com>... > i thought of an unbounded string but the program will not go through > the compiler, no matter which one i use or how i change the program. > > > with Text_io; use Text_io; > procedure main is > ---pre: text is in the mark up language > ---post: text has been converted to english > ---test: once thru > > procedure Get_line is > ---pre:text needs to be input > ---post:text has been input > ---test: once thru > Line_Buffer : String(Unbounded_String); > Line_Length : Natural range 0 .. Line_Buffer'Last; > Line_Store : array (1 .. 10_000) of Unbounded_String; > Line_Count : Natural range 0 .. Line_Store'Last; > begin > loop > Get_Line (Line_Buffer, Line_Length); > Line_Count := Line_Count + 1; > Line_Store (Line_Count) := > To_Unbounded_String (Line_Buffer (1 .. Line_Length)); > new_line; > end loop; > end; > > Procedure doubleslash is > ---pre:mark up language has been input > ---post:doubleslash has been converted to single slash > ---test: /,//,/// > begin > Loop > For i in s'range loop > if s(i)="//" then > s:='/'; > end if; > end loop; > end; > > procedure unformatted is > ---pre: mark up language has been input > ---post:/N tag has left the text formatted as it was > ---test: /N, /N/N,/N/U > Loop > For i in s'range loop > if s(i)=/N then > do nothing > elseif exit > end if; > end if; > end_loop; > End; > > Begin --of main > s:string; > Put("Please enter text: "); > Get_Line(s); > doubleslash; > unformatted; > end; > -------------------Target: Win32 (Intel) Debug-------------------- > main.adb: Error: line 11 col 23 LRM:4.1(3), Direct name, > Unbounded_String, is not visible, Ignoring future references > > main.adb: Error: line 11 col 40 LRM:3.3.1(5), an object declaration > with an indefinite subtype must have an initialization expression, > continuing > > main.adb: Error: line 20 col 7 LRM:4.1(3), Direct name, > To_Unbounded_String, is not visible, Ignoring future references > > main.adb: Error: line 31 col 12 LRM:4.1(3), Direct name, s, is not > visible, Ignoring future references > > main.adb: Error: line 36 col 1 Parse error: expected END_LOOP, got > END, Skipping up to semicolon > > main.adb: Error: line 38 col 1 LRM:5.1(2), Parse error expecting > statement got PROCEDURE, skipping to after next semicolon > > main.adb: Error: line 48 col 5 Parse error: expected END, got END_IF, > Inserting END > > main.adb: Error: line 48 col 5 Parse error: expected SEMICOLON, got > END_IF, Inserting SEMICOLON > > main.adb: Error: line 48 col 5 LRM:3.1(3), Parse error expecting > declaration got END_IF, Skipping to after next semicolon > > main.adb: Error: line 49 col 11 Parse error: expected COLON, got > SEMICOLON, Inserting COLON > > main.adb: Error: line 49 col 11 LRM:4.1(2), Syntax error: the token > SEMICOLON can not be used as a name, skipping to next separator > > main.adb: Error: line 50 col 1 Parse error: expected BEGIN, got END, > Inserting BEGIN > > main.adb: Error: line 50 col 1 LRM:5.1(2), Unexpected ending token END > where statement is required, continuing > > main.adb: Error: line 52 col 1 LRM:10.1.1(5), BEGIN is unexpected > here, Continuing > > main.adb: Error: line 53 col 6 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 53 col 7 LRM:10.1.1(5), COLON is unexpected > here, Continuing > > main.adb: Error: line 53 col 8 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 53 col 14 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > main.adb: Error: line 54 col 1 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 54 col 4 LRM:10.1.1(5), LEFT PARENTHESIS is > unexpected here, Continuing > > main.adb: Error: line 54 col 5 LRM:10.1.1(5), Character String is > unexpected here, Continuing > > main.adb: Error: line 54 col 26 LRM:10.1.1(5), RIGHT PARENTHESIS is > unexpected here, Continuing > > main.adb: Error: line 54 col 27 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > main.adb: Error: line 55 col 1 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 55 col 9 LRM:10.1.1(5), LEFT PARENTHESIS is > unexpected here, Continuing > > main.adb: Error: line 55 col 10 LRM:10.1.1(5), Identifier is > unexpected here, Continuing > > main.adb: Error: line 55 col 11 LRM:10.1.1(5), RIGHT PARENTHESIS is > unexpected here, Continuing > > main.adb: Error: line 55 col 12 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > main.adb: Error: line 56 col 1 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 56 col 12 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > main.adb: Error: line 57 col 1 LRM:10.1.1(5), Identifier is unexpected > here, Continuing > > main.adb: Error: line 57 col 12 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > main.adb: Error: line 58 col 1 LRM:10.1.1(5), END is unexpected here, > Continuing > > main.adb: Error: line 58 col 4 LRM:10.1.1(5), SEMICOLON is unexpected > here, Continuing > > Front end of ..\..\..\..\my documents\cs131\main.adb failed with 34 > errors. (0 Warnings) > Tool execution failed.