[eside-ghost] Problema Definiendo Clase en Free Pascal

Ander Pérez ander.perezgonzalez en gmail.com
Mar Jul 17 18:20:29 CEST 2007


Hola,

hace tiempo que no uso pascal, pero me suena que las clases se definen así:

Type variable_clase = class

                   Subvariable1 : tipo;

                   Subvariable2 : tipo;

                   Subvariable3 : tipo;

                   ...

                   Procedimientos <opcionales>

                   Funciones <opcionales>

End;


Espero que te sirva.


El día 17/07/07, David Santamaria <d.highwayman en gmail.com> escribió:
>
> Aupa,
>
> El día 17/07/07, Geru García <gerupc en gmail.com> escribió:
> >
> >
> > Hola,
> >
> > practicando un poco de Pascal, me surge  un problema compilando el
> > siguiente código en Free Pascal (También he probado en Delphi 7), y me dice
> > quela clase no está completamente definida (Delphi) o que dicho
> > identificador, es decir 'class' no lo encuentra (Free Pascal):
> >
> > program Project2;
> >
> > {$APPTYPE CONSOLE}
> >
> > uses
> >   SysUtils;
> >
> > type
> >   Tusuario = class;
> >     Nombre = string;
> >     Apellidos = string;
> >     Edad = integer;
> >     Socio = boolean;
> >     Codigo_Socio = integer;
> >     procedure Mostrar_Tusuario;
> >   end;
> >
> > procedure Mostrar_Tusuario;
>
>
> procedure Tusuario.Mostrar_Tusuario ;
>
>   Begin
> >       Writeln('Nombre: ', Nombre);
> >       Writeln('Apellidos: ', Apellidos);
> >       Writeln('Edad: ', Edad);
> >
> >       if Socio = True then
> >       write('Si');
> >         else if Socio = False then
> >         write('No')
> >       else
> >       write('No es socio.');
> >
> >       Writeln('Socio: ', Socio);
> >       Writeln('Codigo de Socio: ', Codigo_Socio);
> >
> > var
> >   Geru: Tusuario
> >
> > begin
> >   Geru := Tusuario.create;
> >   Geru.Nombre := 'Geru';
> >   Geru.Apellidos := 'García Blas';
> >   Geru.Edad := 21;
> >   Geru.Socio := True;
> >   Geru.Codigo_Socio := 01;
> >   Geru.Mostrar_Tusuario;
> > end.
> >
> >
> >
> > Gracias de antemano, un saludo;
> >
> > Geru.
> >
> >
> > --
> > --
> > --------------------------------------------------------------@
> > Agur!
> >
> > Aingeru García Blas.
> >
> >
> > www.codigogeru.com
> >
> > gerupc en gmail.com
> >
> > ------------------------------------------------------------@
> > _______________________________________________
> > eside-ghost mailing list
> > eside-ghost en deusto.es
> > https://listas.deusto.es/mailman/listinfo/eside-ghost
> >
>
>
>
> --
> SALUD.
>
> David (a.k.a. Highwayman)
> _______________________________________________
> eside-ghost mailing list
> eside-ghost en deusto.es
> https://listas.deusto.es/mailman/listinfo/eside-ghost
>



-- 
================
Ander Pérez González
================
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: https://listas.deusto.es/mailman/private/eside-ghost/attachments/20070717/85cea7f6/attachment-0001.htm


Más información sobre la lista de distribución eside-ghost