absolute

{它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.}
var
  Str: string[32];
  StrLen: Byte absolute Str;

{这个声明指定了变量StrLen起始地址与Str相同.}
{由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.}
begin
  Str := 'abc';
  Edit1.Text := IntToStr(StrLen);
end;
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-06-18
  • 2021-07-30
  • 2021-06-12
猜你喜欢
  • 2021-07-21
  • 2021-09-14
相关资源
相似解决方案