如何使用TP自带的HELP
以TP7为例, 如果我不知道POS的用法,可以
键入Ctrl+F1
然后键入 pos按回车
出现:
Pos (function)
Searches for a substring in a string. (这一行说明这个函数的主要作用)
Declaration:
function Pos(Substr: String; S: String): Byte; (函数的声明格式)
Target:
Windows, Real, Protected Remarks: (注释)
Substr and S are string-type expressions. Pos searches for Substr within S
and returns an integer value that is the index of the first character of
Substr within S. If Substr is not found, Pos returns zero.
(如果看不懂E文可以用词霸翻一下)
See Also: (和POS相关的函数)
Delete
Concat
Copy
Insert
Length Sample Code: (一个实例来讲解POS的用法)
{Pos.PAS} {Sample code for the Pos function.}
var S: String;
begin
S := ' 123.5';
{ Convert spaces to zeroes }
while Pos(' ', S) > 0 do
S[Pos(' ', S)] := '0';
end.
其实还可以自己编个小程序来进一步了解函数。
|
|