Delphi self-learning series _ learn Delphi's learning thoughts

Source: Internet
Author: User

I haven't visited the blog Park for a long time. Recently I have been busy with a lot of work in the company and I have no time to study.

Why do we need to learn Delphi at this time, mainly because the company has recently introduced several sets of equipment, which uses Delphi. I didn't think of Delphi.

It can seamlessly communicate with Siemens S7 300/400 PLC, and it can also communicate with Siemens's numerical control system at 802d.

I have been using configuration software such as WinCC or InTouch (I don't know how the Chinese people call this software configuration software, because no matter how

The meaning of the word "configuration" cannot be found in both dictionaries and allusions. If it is not self-controlled, it is estimated that the meaning of the word "configuration" cannot be understood for a lifetime.

With) too many restrictions,ProgramSometimes it is difficult for developers to implement their own ideas, and such software is usually very large (currently WinCC v6.2 installation package 2G +,

The installation package of v7.0 is 3G +). After installation, the computer will be completely suspended, which is slower than the tractor. Now I see a development tool that is relatively easy to get started and has powerful functions (I know

Any development tool can achieve communication with PLC), so I want to learn. (Delphi looks better at developing win APIs than VB ).

Last weekend, I spent two days studying Delphi and found that it was not as simple as I thought. Below is a section of my own exercisesCodeThere are a lot of things you don't understand.

Hope you can advise me.

Exp:

Program typetest; {$ apptype console} uses sysutils; // The interface does not know why it cannot be used in this place. // can it be used only in unit files? {Originally, I would like to declare only the functions and processes under the Implemetation clause of the function and process prototype here. The result shows that it is not feasible} var inum1: integer; inum2: integer; chvar: Char; STR: string; // declaer fuctionfunction getnum (): integer; var STR: string; begin writeln ('Please input a number'); {I do not know how to read numbers from the console, you can only use this method. If a character is entered in this method, an exception will occur, and you do not know why the exception cannot be captured for processing. If the character is entered, the program will be discarded. I don't know if the hero can give advice to one or two} readln (STR); try result: = strtoint (STR); expect t writeln ('there is a exception when run this program '); end; end; function getsum (ivar1, ivar2: integer): integer; begin result: = ivar1 + ivar2; end; function getchar (): Char; var STR: string; begin readln (STR); Result: = STR [2]; // it seems that the ansistring object can be processed like an array, but when I look at the developer guide, why can't I do this? It is strange that end; var ivar1: integer; ivar2: integer; Ch: Char; {implementation does not know why this keyword cannot be used in this place} begin {todo-ouser-cconsole main: insert code here} ivar1: = getnum; ivar2: = getnum; // I Don't Know How To press enter to wrap in the writeln function? // Google: // 'abc' + #13 #10 // #13 indicates the carriage return. // #10 indicates the linefeed writeln ('the sum of ', inttostr (ivar1 ), 'and', inttostr (ivar2), 'is ', #13, #10, inttostr (getsum (ivar1, ivar2); Ch: = getchar; writeln (CH ); readln (STR); end. {I used to define a function after the main function like in C. I found that the function is unavailable. I don't know why? Or are there other special settings? I don't know what the hero can do ?} // There is a warning: typetest. DPR [75]: text after final 'end. '-ignored by compiler // The system prompts an alarm. the Terminator is followed by text. The Compiler ignores all the subsequent text and explains the previous problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.