小程序无法使用代码保护功能
Have you ever found yourself writing the same code over and over to perform some common task within event handlers? Yes! It's time for you to learn about programs within a program. Let's call those mini-programs subroutines.
您是否发现自己一遍又一遍地编写相同的代码来执行事件处理程序中的某些常见任务? 是! 现在是时候让您了解程序中的程序了。 我们将这些微型程序称为子例程。
子程序简介 ( Intro to subroutines )
Subroutines are an important part of any programming language, and Delphi is no exception. In Delphi, there are generally two types of subroutines: a function and a procedure. The usual difference between a function and a procedure is that a function can return a value, and a procedure generally will not do so. A function is normally called as a part of an expression.
子程序是任何一个重要组成部分的编程语言 ,以及德尔福也不例外。 在Delphi中,通常有两种子程序类型:函数和过程。 函数和过程之间的通常区别是函数可以返回值,而过程通常不会这样做。 函数通常被称为表达式的一部分。
Take a look at the followi