Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Pascal/Delphi

Pascal/Delphi Forum for discussing Borland Delphi and Pascal coding techniques, tips and tricks.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-25-2007, 12:27 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,392
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

I wonder if your "TForm1 = class(TForm)" is incorrect. I would think that should be "TForm1 : TForm;".
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-25-2007, 12:43 PM
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
Default

Quote:
Originally Posted by WingedPanther View Post
I wonder if your "TForm1 = class(TForm)" is incorrect. I would think that should be "TForm1 : TForm;".
Nope, it's the default when i create a new application. If i change it i get an error
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-25-2007, 02:25 PM
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
Default

i've found the solution already thanks anyway
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-11-2007, 02:46 PM
Meka][Meka Meka][Meka is offline
Newbie
 
Join Date: Jun 2007
Location: If Statement
Posts: 4
Rep Power: 0
Meka][Meka is on a distinguished road
Default

an old thread but hey, im new ^__^, plus a help for other programmers or newbies that have the same problem ->

simple because the nested class is declared incorrectly...

example of nested class >

Code:
type
TSomeClass = class
public
	iSomeInt: Integer;
	type
	TNestedClass = class
	public
		function Method(): Boolean;
	end;
end;

and from the displayed code i dont see an ending

Code:
end.
-/Meka][Meka

Last edited by Meka][Meka; 06-11-2007 at 02:48 PM. Reason: missed something ;)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue writing to file: pointer to a class which contains pointers to other classes Sheemer C and C++ 0 08-21-2007 02:17 AM
Java:Tutorial - "Hello World" John Java Tutorials 10 07-17-2007 05:58 PM
need help on class project javic Java Help 4 02-19-2007 04:31 PM
Java Help Files xXHalfSliceXx Java Help 3 11-29-2006 12:30 AM


All times are GMT -5. The time now is 02:57 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads