Hello world/Grafici: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Sostituito "Hello World!" con "hello, world" come da originale ed aggiunto R (software statistico GNU).
Nessun oggetto della modifica
Riga 261:
Versione corta:
pack [label .label1 -text "Hello World"]
 
=== Turbo Pascal 7.0 (con Turbo Vision), per DOS ===
Versione con MessageBox
program Hello;
uses App, MsgBox;
type
THelloApplication = object(TApplication)
constructor Init;
procedure DoAboutBox;
end;
constructor THelloApplication.Init;
begin
inherited Init;
DoAboutBox;
end;
procedure THelloApplication.DoAboutBox;
var
Res: Word;
begin
Res := MessageBox('hello, world', nil, mfInformation);
end;
var
HelloApplication: THelloApplication;
begin
HelloApplication.Init;
HelloApplication.Run;
HelloApplication.Done;
end.
Versione con Window ed ereditarietà.
program Hello;
uses App, Dialogs, Objects, Views;
type
PHelloWindow = ^THelloWindow;
THelloWindow = object(TWindow)
constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Integer);
end;
THelloApplication = object(TApplication)
constructor Init;
end;
constructor THelloWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Integer);
var
R: TRect;
begin
inherited Init(Bounds, ATitle, ANumber);
R.Assign(2, 2, 37, 3);
Insert(New(PStaticText, Init(R, 'hello, world')));
end;
constructor THelloApplication.Init;
var
R: TRect;
begin
inherited Init;
R.Assign(3, 3, 50, 14);
InsertWindow(New(PHelloWindow, Init(R, 'Hello world program', 1)));
end;
var
HelloApplication: THelloApplication;
begin
HelloApplication.Init;
HelloApplication.Run;
HelloApplication.Done;
end.
 
 
=== [[Visual Basic .Net]] ===