大榕树 \ Pascal语言 \ Pascal入门

如何使用TP自带的HELP

原文链接:http://www.mydrs.org/program/list.asp?id=472

以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.
其实还可以自己编个小程序来进一步了解函数。

作者:lyj_george
来源:本站论坛
时间:2003-03-19

上一篇:USACO三月竞赛绿色题目
下一篇:2003年安徽省组队赛试题

大榕树 版权所有 ©1999-2006