Lost Password?

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

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

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, 10:49 AM
tosh5457's Avatar   
tosh5457 tosh5457 is offline
Newbie
 
Join Date: May 2007
Location: Portugal
Age: 16
Posts: 7
Credits: 0
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, 11:27 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,397
Last Blog:
wxWidgets is NOT code ...
Credits: 685
Rep Power: 27
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

I wonder if your "TForm1 = class(TForm)" is incorrect. I would think that should be "TForm1 : TForm;".
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-25-2007, 11:43 AM
tosh5457's Avatar   
tosh5457 tosh5457 is offline
Newbie
 
Join Date: May 2007
Location: Portugal
Age: 16
Posts: 7
Credits: 0
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, 01:25 PM
tosh5457's Avatar   
tosh5457 tosh5457 is offline
Newbie
 
Join Date: May 2007
Location: Portugal
Age: 16
Posts: 7
Credits: 0
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, 01:46 PM
Meka][Meka Meka][Meka is offline
Newbie
 
Join Date: Jun 2007
Location: If Statement
Posts: 4
Credits: 0
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 01: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

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 01:17 AM
Java:Tutorial - "Hello World" John Java Tutorials 10 07-17-2007 04:58 PM
need help on class project javic Java Help 4 02-19-2007 03:31 PM
Java Help Files xXHalfSliceXx Java Help 3 11-28-2006 11:30 PM


All times are GMT -5. The time now is 04:47 AM.

Contest Stats

Xav ........ 1097.16
MeTh0Dz|Reb0rn ........ 986.37
morefood2001 ........ 850.04
John ........ 841.93
WingedPanther ........ 684.54
marwex89 ........ 638.26
Brandon W ........ 493.36
chili5 ........ 292.12
Steve.L ........ 188.37
orjan ........ 187.41

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 79%

Ads