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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: confusion about message passing between the tasks Date: Sun, 26 Oct 2014 15:40:22 +0000 Organization: A noiseless patient Spider Message-ID: References: <0ad95e3c-de3c-4ff2-96e3-76b065117cab@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="71797db6fbf0039ebda7a9c799ddb33f"; logging-data="21418"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sc/Ia8SfJcaHGhWz5f/7aP5a7xssPkPg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:QPwTK99klEley++G54wyY/aNQkE= sha1:aq0koFDWYQpCP0RNoxZ6l4NiPj0= Xref: news.eternal-september.org comp.lang.ada:22757 Date: 2014-10-26T15:40:22+00:00 List-Id: compguy45@gmail.com writes: > 22 select > 23 accept Get (Check : Integer ; Value : out Integer) do Make it "Value : in out Integer" (because you need to know the current value). > 24 -- put("Value of Check is "); put(Check);new_line; > 25 V := Check; Here is the nub of your problem: you always assign Check to V (and your calling code always has Check = 0). Delete this line. > 26 V := V + 1; And this line. And the declaration of V. > 27 Value := V; Make this line Value := Value + 1; > 28 put("Value V the accept block is ");put(V);new_line; And make this Put(Value). > 29 end Get; >