absolute
{它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.} var Str: string[32]; StrLen: Byte absolute Str; {这个声明指定了变量StrLen起始地址与Str相同.} {由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.} begin Str := 'abc'; Edit1.Text := IntToStr(StrLen); end;
{它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.} var Str: string[32]; StrLen: Byte absolute Str; {这个声明指定了变量StrLen起始地址与Str相同.} {由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.} begin Str := 'abc'; Edit1.Text := IntToStr(StrLen); end;
相关文章: