View Single Post
  #1 (permalink)  
Old 05-25-2007, 11:49 AM
tosh5457's Avatar   
tosh5457 tosh5457 is offline
Newbie
 
Join Date: May 2007
Location: Portugal
Age: 16
Posts: 7
Rep Power: 0
tosh5457 is on a distinguished road
Smile Class question in Delphi

I've been learning delphi for 3 days now, so I'm just a begginer . anyway I've got a problem making a class ( : expected but = found ) here is the code:

Quote:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
TWrite = class
private
word1 : string;
word2 : string;
word3 : string;
word4 : string;
public
constructor CreateVal(Aword1,Aword2,Aword3,Aword4 : string);
end;

constructor TWrite.CreateVal(Aword1,Aword2,Aword3,Aword4 : string);
begin
inherited create;
word1 := Aword1;
word2 := Aword2;
word3 := Aword3;
word4 := Aword4;
end;
When i try to run it it says "Expected ':' but '=' found." and it points to TWrite=class

I remember having this problem when making records, but that was because i forgot end;

Help me please
Reply With Quote

Sponsored Links