1

I have a problem with my project. The issue problem with linking a package and visibility of the tasks.

in bufor1.ads

package bufor1 is
    task type Bufor is
        entry Przyjmij(Wyrob: in Typ_Wyrobow; Numer: in Integer);
        entry Wydaj(Zestaw: in Typ_Zestawow; Numer: out Integer);
    end Bufor;
end bufor1;

in another ads file I want to call Wydaj function like that:

with bufor1; use bufor1;
...
bufor1.Bufor.Wydaj(Rodzaj_Zestawu, Numer_Zestawu);

which causes the error:

invalid use of subtype mark in expression or call

I'm new user of ADA. Thank in advance for your time. Greetings.

GrumpyCrouton
  • 8,486
  • 7
  • 32
  • 71

1 Answers1

4

You are trying to make calls to a task type, not a task object. Either make it a task object (of an anonymous task type):

task Bufor is

or create a task object:

foo : bufor1.Bufor; ... foo.Wydaj(Rodzaj_Zestawu, Numer_Zestawu);

egilhh
  • 6,464
  • 1
  • 18
  • 19