During the development of ActiveX using C # in the past two days, no matter how it is done, C # cannot generate pure ActiveX controls for ocx, and it also forces users to install huge ones. net Framework (I just want to make a simple screenshot function ActiveX integrated into the Silverlight chat room), so I think of Delphi, which has been used for a year, although time passes, now it is. net, but it is undeniable that Delphi is still a Win32 nativeProgramOne of the best development tools.
For more information about Delphi syntax, see the CHM document.
Http://d.namipan.com/d/d026cf6a2a78de9569248d7579fc2adccb3f8e01e5ba5500
First, create a leleapplication (DOS window program)
File --> New --> Other --> console application
CodeAs follows:
Program Project1;
{ $ Apptype Console }
Uses // Equivalent to the using namespace
Sysutils;
var // define variable
I: integer;
S: string ;< BR >_ set : set of char; // set type
Const
Author:String ='Jimmy';//Constant string
Resourcestring
Author2= 'Yjmyzz';//Resource string
//Define a process
ProcedureMyproc (MSG:String);
Begin
Writeln ('Myproc is called:' +MSG );
End;
// Define a function
Function Myfunc (MSG: String ): String ;
Begin
Result: = ' Myfunc is called ' + MSG;
End ;
// Start of main method
Begin
Writeln ( ' Hello World ' ); // Output, equivalent to console. writeln ("XXX") in C ")
Writeln ( '' );
For I: = 0 To 10 Do // Loop
Begin
S: = ' This is a number ' + Inttostr (I );
Writeln (s );
End ;
Writeln ( ' -------------------------- ' );
Myproc ( ' Jimmy ' ); // Call Process
Writeln (myfunc ( ' Jimmy. Yang ' )); // Call a function
Writeln ( ' -------------------------- ' );
Writeln (author ); // Output constant
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-dd hh: NN: SS ' , Now ));
Writeln ( ' -------------------------- ' );
I: = INTEGER ( ' A ' );
Writeln (I );
Writeln (ord ( ' A ' ));
Writeln (CHR ( 97 ));
Writeln (# 10 + ' Press any key to exit... ' );
Readln; // Wait for keyboard input
End .