Because functions return a value, function calls are expressions. For example, if you’re defined a function called Calc that takes two integer arguments and returns an integer, then the function call Calc(24, 47) is an integer expression. If I and J are integer variables, then I + Calc(J, 8) is also an integer expression. Examples of function calls include
Sum(A, 63)
Maximum(147, J)
Sin(X + Y)
Eof(F)
Volume(Radius, Height)
GetValue
TSomeObject.SomeMethod(I,J);
For more information about functions, see Procedures and functions.
Procedure and functions: Overview
因为函数返回值,因此函数调用是表达式。例如,如果定义了一个名为Calc的函数,该函数接受两个整数参数并返回一个整数,那么函数调用 Calc(24, 47) 是一个整数表达式。如果I和J是整型变量,那么 I + Calc(J, 8) 也是一个整型表达式。下面列出典型的函数调用范例:
Sum(A, 63)
Maximum(147, J)
Sin(X + Y)
Eof(F)
Volume(Radius, Height)
GetValue
TSomeObject.SomeMethod(I,J);
有关函数的更多信息,见过程和函数。