声明:const MaxInt = High(Integer);
描述:MaxInt常量给出一个Integer类型所允许的最大数值。
这个值通常是2^32 –1 = 2147483647,但并不保证在所有的Delphi版本中都是这个值。
var Source, Target : string; begin Source := 'Assume that we do not know how long this string is'; //拷贝从第8个开始的所有字符 Target := Copy(Source, 8, MaxInt); ShowMessage('Source : '+Source); ShowMessage('Target : '+Target); end;
程序运行结果:
Source : Assume that we do not know how long this string is
Target : that we do not know how long this string is