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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,85c103793571fa8d,start X-Google-Attributes: gid103376,public From: "Mattias" Subject: Problem with dynamic dispatching (Polymorphism) Date: 1999/04/25 Message-ID: <7fvfcm$cfi$1@news.lth.se>#1/1 X-Deja-AN: 470715226 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.1300 Organization: Lund Institute of Technology, Sweden X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 1999-04-25T00:00:00+00:00 List-Id: Hi! I�m developing a simple linked list to hold different data types.. I have to one superclass , with two derived classes.. I have declared a 'Class type which I use to access all of my structures, I have no trouble adding data to the list. The error occures when I wan't to extract the data and Print it to the screen.. look at the following code example: program.ads: type T�cken is tagged null record; type Siffra is new Tecken with Record Element : Integer; end record; procedure Print(S : Siffra); type Bokstav is new T�cken with record Element : Character; end record; procedure Print(B : Bokstav); type pTecken is access all Tecken'Class; program.adb -- I have to simple procedures which Print the values of Class bokstav, '' notice .. pekare is of type pTecken .. procedure Print(B : Bokstav) is begin Put(B.Element); end Print; procedure Print(S : Siffra) is package Iio is new Integer_Io(Integer); use Iio; begin put(S.Element); end Print; -- Then I have this procedure to extract the elements from the list. Pekare is Pocedure Display is begin while Lista /= null loop Print(Lista.Pekare); Lista := Lista.Next; end loop; end Display; Really need help on this one thx Mattias