The original: Relive the console program of Delphi: Hello world!
This two-day development of ActiveX in C #, found no matter how, C # is no way to generate OCX pure ActiveX control, but also to force users to install a huge. Net The framework (I just want to do a simple screenshot of the ActiveX integration into the Silverlight chat room), and then think of the once used for a year of Delphi, although the passage of time, As early as the world of. NET, it is undeniable that Delphi is still one of the best development tools for Win32 native programs.
About Delphi Grammar Learning, you can see this CHM document, basically a day to read
http://d.namipan.com/d/d026cf6a2a78de9569248d7579fc2adccb3f8e01e5ba5500
First to make a consoleapplication (that is, DOS window program)
File-->new-->other-->console Application
The code is as follows:
ProgramProject1;
{$APPTYPE CONSOLE}
uses //equivalent to a using namespace
Sysutils;
var //Defining variables
I:integer;
S:string;
_Set:Set ofChar;//collection type
Const
Author:string ='Jimmy';//constant string
resourcestring
Author2= 'Yjmyzz';//Resource string
//Define a process
procedureMyProc (msg:string) ;
begin
Writeln ('MyProc is called by:' +msg);
End;
//Define a function
functionMyFunc (msg:string):string;
begin
Result:= 'MyFunc is called by' +msg;
End;
//the beginning of the Main method
begin
Writeln ('Hello World');//output, equivalent to Console.writeln ("xxx") in C #
Writeln ("');
forI:=0 to Ten Do //Loops
begin
S:= 'This is a number .' +IntToStr (i);
Writeln (s);
End;
Writeln ('--------------------------');
MyProc ('Jimmy'); //Call procedure
Writeln (MyFunc ('Jimmy.yang')); //calling functions
Writeln ('--------------------------');
Writeln (Author); //Output Constants
Writeln (AUTHOR2); //Output Resource string
Writeln ('--------------------------');
Writeln ('Integer:');
Writeln (SizeOf (Integer));
Writeln (High (Integer));
Writeln (Low (Integer));
Writeln ('--------------------------');
Writeln ('i=' +IntToStr (i));
Dec (i); //I minus 1, equivalent to I:=I-1;
I:=I-1;
Writeln ('i=' +IntToStr (i));
Writeln (ODD (i));
Writeln ('--------------------------');
Writeln (FormatDateTime ('yyyy mm month DD Day HH:NN:SS', now));
Writeln ('--------------------------');
I:=Integer ('A');
Writeln (i);
Writeln (Ord ('a'));
Writeln (CHR ( the));
Writeln (#Ten + 'Press any key to exit ...');
READLN; //Wait for keyboard input
End.
Relive the Delphi console program: Hello world!