Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 15-05-2006
lanp_prospero lanp_prospero is offline
Registrado
 
Registrado: abr 2006
Posts: 6
Poder: 0
lanp_prospero Va por buen camino
Delphius:
eso intente hacer pero me da un explote, tengo puesto este codigo.

//aqui defino la clase

unit Unit2;
interface
Type
TNumeros = class
private
protected
Fa: integer;
Fb: integer;
public
constructor Create(_Fa, _Fb: integer);
function Suma: integer;
property A:integer read Fa write Fa;
property B:integer read Fb write Fb;
published
end;

implementation
{ TNumeros }
constructor TNumeros.Create(_Fa, _Fb: integer)
begin
Self.Fa:=_Fa;
Self.Fb:=Fb;
end;
function TNumeros.Suma: integer;
begin
Result:=Fa + Fb;
end;
end.

//aqui defino la parte de la forma

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit2, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Edit3: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
numeros: TNumeros;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
numeros.Create(StrToInt(Edit1.Text), StrToInt(Edit2.Text));
Edit3.Text:=IntToStr(numeros.Suma);
end;
end.

mira a ver y dime que podria ser.

gracias
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Delphi VS Visual Basic woody Debates 137 18-03-2008 14:54:00
Delphi V/s Visual Basic lavtaro Varios 13 02-05-2006 14:30:47
Creando componente visual piccolo2101 Varios 4 25-01-2006 14:13:45
Problema con librería en Visual C++ llauraff Varios 0 16-09-2004 14:36:20
Tablas dbf-fpt (¿Visual Fox Pro?) ogorut Tablas planas 2 24-11-2003 10:04:22


La franja horaria es GMT +2. Ahora son las 05:42:11.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi