comp.lang.ada
 help / color / mirror / Atom feed
* Serious problem: Begin ignored! Please help!
@ 1997-10-17  0:00 Greg Kelley
  1997-10-19  0:00 ` William & Melissa Thornton
  1997-10-20  0:00 ` Tucker Taft
  0 siblings, 2 replies; 4+ messages in thread
From: Greg Kelley @ 1997-10-17  0:00 UTC (permalink / raw)



I have been trying for hours to get rid of the following error and keep
hitting brick walls
Someone please give me some assistance. I am programming on a DEC machine.

The error is:

BEGIN
^
ada: Error: machine_problem_1.ada, line 39: Ignored reserved-word "begin"

And my program (up to the error is:

WITH Fractions, G_Stack, Text_IO, Integer_Text_IO;
USE  Fractions, Text_IO, Integer_Text_IO;

PROCEDURE Machine_Problem_1 IS

Expression : String(1..80);
Expression_Length : integer;
temp :  String(1..20);
temp_frac :  fraction_type;
temp_frac1 :  fraction_type;
Start :  integer;
Times : boolean;
Total : fraction_type;


  PROCEDURE Convert(frac_string   : IN string;
                    string_length : IN integer;
                    frac          : OUT fraction_type) IS

    I : integer;

  BEGIN
    I := 1;
    LOOP
    EXIT WHEN Line(I) = '/';             -- Find location of '/'
      IF I = Length
        THEN I := 0;
             EXIT;
      END IF;
      I := I + 1;
    END LOOP;
    IF I = 0                            -- Create new fraction
      THEN Frac := (Fraction (Integer'Value(Line(1..Length))));
      ELSE Frac := (Integer'Value (Line(1..(I-1)))) /
                             (Integer'Value(Line((I+1)..Length)));
    END IF;
  END Convert;

BEGIN       --error line! 

I know it's probably something not to difficult and I'm just over looking
the problem.

I greatly appreciate your time and if you could answer via e-mail I would
greatly appreciate it.

gkelley@css.tayloru.edu






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Serious problem: Begin ignored! Please help!
  1997-10-17  0:00 Serious problem: Begin ignored! Please help! Greg Kelley
@ 1997-10-19  0:00 ` William & Melissa Thornton
  1997-10-22  0:00   ` Robert S. White
  1997-10-20  0:00 ` Tucker Taft
  1 sibling, 1 reply; 4+ messages in thread
From: William & Melissa Thornton @ 1997-10-19  0:00 UTC (permalink / raw)



This is a multi-part message in MIME format.
--------------01E9ACEF4723125A903D008A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

You have begin listed twice.  You can't begin more than once. :)

Greg Kelley wrote:
>
> I have been trying for hours to get rid of the following error and keep
> hitting brick walls
> Someone please give me some assistance. I am programming on a DEC machine.
>
> The error is:
>
> BEGIN
> ^
> ada: Error: machine_problem_1.ada, line 39: Ignored reserved-word "begin"
>
> And my program (up to the error is:
>
> WITH Fractions, G_Stack, Text_IO, Integer_Text_IO;
> USE  Fractions, Text_IO, Integer_Text_IO;
>
> PROCEDURE Machine_Problem_1 IS
>
> Expression : String(1..80);
> Expression_Length : integer;
> temp :  String(1..20);
> temp_frac :  fraction_type;
> temp_frac1 :  fraction_type;
> Start :  integer;
> Times : boolean;
> Total : fraction_type;
>
>   PROCEDURE Convert(frac_string   : IN string;
>                     string_length : IN integer;
>                     frac          : OUT fraction_type) IS
>
>     I : integer;
>
>   BEGIN
>     I := 1;
>     LOOP
>     EXIT WHEN Line(I) = '/';             -- Find location of '/'
>       IF I = Length
>         THEN I := 0;
>              EXIT;
>       END IF;
>       I := I + 1;
>     END LOOP;
>     IF I = 0                            -- Create new fraction
>       THEN Frac := (Fraction (Integer'Value(Line(1..Length))));
>       ELSE Frac := (Integer'Value (Line(1..(I-1)))) /
>                              (Integer'Value(Line((I+1)..Length)));
>     END IF;
>   END Convert;
>
> BEGIN       --error line!
>
> I know it's probably something not to difficult and I'm just over looking
> the problem.
>
> I greatly appreciate your time and if you could answer via e-mail I would
> greatly appreciate it.
>
> gkelley@css.tayloru.edu

--
                               /T /I
                              / |/ | .-~/
                          T\ Y  I  |/  /  _
         /T               | \I  |  I  Y.-~/
        I l   /I       T\ |  |  l  |  T  /
     T\ |  \ Y l  /T   | \I  l   \ `  l Y
 __  | \l   \l  \I l __l  l   \   `  _. |
 \ ~-l  `\   `\  \  \\ ~\  \   `. .-~   |
  \   ~-. "-.  `  \  ^._ ^. "-.  /  \   |
.--~-._  ~-  `  _  ~-_.-"-." ._ /._ ." ./
 >--.  ~-.   ._  ~>-"    "\\   7   7   ]
^.___~"--._    ~-{  .-~ .  `\ Y . /    |
 <__ ~"-.  ~       /_/   \   \I  Y   : |
   ^-.__           ~(_/   \   >._:   | l______
       ^--.,___.-~"  /_/   !  `-.~"--l_ /     ~"-.
              (_/ .  ~(   /'     "~"--,Y   -=b-. _)
               (_/ .  \  :           / l      c"~o \
                \ /    `.    .     .^   \_.-~"~--.  )
                 (_/ .   `  /     /       !       )/
                  / / _.   '.   .':      /        '
                  ~(_/ .   /    _  `  .-<_
                    /_/ . ' .-~" `.  / \  \          ,z=.
                    ~( /   '  :   | K   "-.~-.______//
                      "-,.    l   I/ \_    __{--->._(==.
                       //(     \  <    ~"~"     //
                      /' /\     \  \     ,v=.  ((
                    .^. / /\     "  }__ //===-  `
                   / / ' '  "-.,__ {---(==-
                 .^ '       :  T  ~"   ll
                / .  .  . : | :!        \\
               (_/  /   | | j-"          ~^
                 ~-<_(_.^-~"
--------------01E9ACEF4723125A903D008A
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Thornton, William & Melissa
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             William & Melissa Thornton
n:              Thornton;William & Melissa
adr:            103A Paisley Court;;;Bozeman;Montana;59715-7321;USA
email;internet: thornton@avicom.net
tel;home:       406-586-9166
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------01E9ACEF4723125A903D008A--




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Serious problem: Begin ignored! Please help!
  1997-10-17  0:00 Serious problem: Begin ignored! Please help! Greg Kelley
  1997-10-19  0:00 ` William & Melissa Thornton
@ 1997-10-20  0:00 ` Tucker Taft
  1 sibling, 0 replies; 4+ messages in thread
From: Tucker Taft @ 1997-10-20  0:00 UTC (permalink / raw)



Greg Kelley (gkelley@css.tayloru.edu) wrote:

: I have been trying for hours to get rid of the following error and keep
: hitting brick walls
: Someone please give me some assistance. I am programming on a DEC machine.

Your source code looks fine to me.  It may be that you have a syntax
error *after* the BEGIN, and the compiler is deciding that the best way
to correct for the error is to ignore the "BEGIN".

In any case, whenever you have a problem like this, it is important
to include the *entire* program, not just a "snippet", plus the
exact listing output produced by the compiler.
Otherwise, it may be difficult to reproduce the problem.

: The error is:

: BEGIN
: ^
: ada: Error: machine_problem_1.ada, line 39: Ignored reserved-word "begin"

: And my program (up to the error is:

..

: gkelley@css.tayloru.edu

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Serious problem: Begin ignored! Please help!
  1997-10-19  0:00 ` William & Melissa Thornton
@ 1997-10-22  0:00   ` Robert S. White
  0 siblings, 0 replies; 4+ messages in thread
From: Robert S. White @ 1997-10-22  0:00 UTC (permalink / raw)



In article <344A1373.95FA957A@avicom.net>, thornton@AVICOM.NET says...
>
>This is a multi-part message in MIME format.
>--------------01E9ACEF4723125A903D008A
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>You have begin listed twice.  You can't begin more than once. :)

  His actual problem was that he did not have a BEGIN / END for his
outermost procedure.  I e-mailed a couple of days ago to him an 
edited version of his source that compiled OK under GNAT (except for 
the missing FRACTIONS.ADS spec).  Have not received any response.

  A fine line between helping students with their homework too much 
versus trying to keep them from getting discouraged.
_____________________________________________________________________
Robert S. White         -- An embedded systems software engineer
e-mail reply to reverse of: ia us lib cedar-rapids crpl shift2 whiter





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-10-22  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-17  0:00 Serious problem: Begin ignored! Please help! Greg Kelley
1997-10-19  0:00 ` William & Melissa Thornton
1997-10-22  0:00   ` Robert S. White
1997-10-20  0:00 ` Tucker Taft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox