[ Napushenko @ 10.02.2007. 14:30 ] @
Skino sam sa neta ovaj code i kad sam probo da ga kompilujem javlja mi neku gresku,a sta je greska ne znam.Sumnjam da je u kodu...
Code:
Program Demo1;

uses WinTypes, WinProcs, OWindows; 
{Tells the compiler which libraries are needed}

type
  PTheWindow = ^TTheWindow;  
{creates a pointer ready for the main window}
  TTheWindow = object(TWindow) 
{assigns the pointer to the window}
    procedure Paint(PaintDC: HDC;  
var PaintInfo: TPaintStruct); virtual;
end;

{ The procedure Paint is included because }
{Windows frequently hides one}
{ window behind another. Paint recreates }
{what has been covered over}

TTheApplication = object(TApplication)
  procedure InitMainWindow; virtual;
end;

procedure TTheWindow.Paint;
begin
  {later, we'll draw certain graphics }
{by adding to this procedure}
end;

procedure TTheApplication.InitMainWindow;
begin
  MainWindow := New(PTheWindow, Init(nil, 'A Program')); 
{Create the window}
end;

var
  TheApp: TTheApplication;

begin
  TheApp.Init('A Program');
  TheApp.Run;
  TheApp.Done;
end.

Run the program and it will display a blank window. 
Click the control window in the top
right hand corner of the window (for Windows 3.0 and 3.1) 
and select close.

What happened? Our graphics program created a window 
OBJECT. The object was
based on ObjectWindows through the line:

  TTheWindow = object(TWindow)

This works because ObjectWindows acts as the parent 
and TTheWindow is the child,
inheriting the behaviour of the TWindow parent. So, when 
we tell TTheWindow to do
something, like Paint:

procedure TTheWindow.Paint;

TTheWindow calls the parent, TWindow, and waits until 
the parent has sorted everything
out before the child, TTheWindow, will do anything else.

TTheWindow is descended from TWindow - it cannot
function without TWindow being
able to sort out the things that TWindow is good at 
sorting out. (Namely, creating and
controlling the window and user input/output.) At 
the moment, TTheWindow has learnt
nothing about doing anything for itself - that will 
come with later versions of the program.

Exactly the same happens with TApplication and 
TheApp. In this case, the child (TheApp)
asks the parent to initialise the application 
(TheApp.Init('A Program')), and Run the new
application. Finally, TheApp simply tells the 
parent that the job is Done.
[ Bojan Kopanja @ 10.02.2007. 16:44 ] @
Ako si ovo sve kopirao onda ti je greska sve iza linije end.
[ viking13 @ 11.02.2007. 00:00 ] @
Prikazao si screenshot sa totalno drugačijim kodom od ovoga o kome pišeš ovde.

Totalno nebitne stvari si ostavio vidljive, a najbitniju stvar: Compiler Messages si sasekao.

Interesantno...
[ viking13 @ 11.02.2007. 00:02 ] @
Citat:
Strog: Ako si ovo sve kopirao onda ti je greska sve iza linije end. :D


Svaki normalan kompajler ignoriše sve iza poslednje validne linije u ovom slučaju end.
[ Bojan Kopanja @ 11.02.2007. 00:05 ] @
Citat:
viking13: Svaki normalan kompajler ignoriše sve iza poslednje validne linije u ovom slučaju end.


Vidis, nisam to ni probavao nikad u zivotu :D...

Evo sad sam probao i dobio sam owarning:

[Warning] Unit1.pas(25): Text after final 'END.' - ignored by compiler

Znaci to definitivno nije greska ;).