comp.lang.ada
 help / color / mirror / Atom feed
* Programming Queues in ADA (Very Urgent)
@ 2000-05-10  0:00 S|r |ceman
  2000-05-10  0:00 ` Charles Hixson
  2000-05-10  0:00 ` Ted Dennison
  0 siblings, 2 replies; 6+ messages in thread
From: S|r |ceman @ 2000-05-10  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

H. I need to program a queue in ADA, dont know if queue is the real word in
English, but you will understand FIFO stack I think ;-)

I dont know who to delete an element from the FIFO stack. I have implemented
it under pointers, and the thing is like this:


.ADS Stack Specification:


    type NodoCola;
    type Puntero is access NodoCola;

    type NodoCola is record

        Elemento: Tipo_Elemento;
        Next: Puntero;

    end record;


    type Cola is record

        Registro: Puntero;
        NumElem: Natural := 0;

    end record;



Deleting the element in out position:

    procedure Extraer (C: in out Cola) is

        Aux: Puntero := new NodoCola;

    begin

        Aux := C.Registro;

        if (Es_Vac�a(C)) then

            raise E_Cola_Vac�a;

        else

            C.Registro := C.Registro.Next;

            C.NumElem := C.NumElem - 1;

        end if;

    end Extraer;


Thank you for helping me with this ;-)

See ya.

P.D. If anyone of you could help me, please could you answer into my mailbox
:? Thanks anyway ;-)


[|] Miguel Angel P�rez (S|r |ceman).
[|] Administrador General de Networking Center(R), 2000
[|] Email: iceman@webshack-cafe.com
              iceman@networking-center.org
              admin@networking-center.org

[|] Networking Center(R) - Proyecto C.I.R.I.T.

[|] Web: http://www.networking-center.org
[|] FTP: ftp://ftp.networking-center.org
[|] IRC: IRC Hispano, [irc.irc-hispano.org], Canal: #Networking.







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

end of thread, other threads:[~2000-05-11  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-10  0:00 Programming Queues in ADA (Very Urgent) S|r |ceman
2000-05-10  0:00 ` Charles Hixson
2000-05-10  0:00 ` Ted Dennison
2000-05-11  0:00   ` David C. Hoos, Sr.
2000-05-11  0:00     ` Ted Dennison
2000-05-11  0:00     ` Pascal Obry

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